Query Multiple Files

From: This is used to select the files to query on. You can query a single file or multiple files:

  1. Single file:
  2. Syntax: FROM <filename>.

    Example: FROM account.xls

  3. Comma separated:
  4. Syntax: FROM <fileName1>, <fileName2>

    Example: FROM account.xls, ./old/nov-account.xls, ./old/oct-account.xls

  5. Wild card:
  6. Syntax: FROM <partialName>*.xls

    Example: FROM ./old/*-account-2007.xls

    Example: FROM ./old/*-account-*.xls

  7. Single zip file:
  8. Syntax: FROM <fileName>@<zipFileName>

    Example: FROM jon-nov-2007.xls@emp-expenses.zip

  9. Wild card file name:
  10. Example: FROM jon-*-2007.xls@emp-expenses.zip

  11. Wild card zip files:
  12. Example: FROM jon.xls@*-expenses.zip




Use: Specify the Meta to use when reading the data file.

  1. Custom Meta: Used when you have the meta defined in an XML file as described in the section ‘Meta file’. This can be used in two ways:
    • If the meta file has only one meta or the default configuration defined:
    • Syntax: USE <metafile>

      Example: USE ./meta/apacheConfig.xml

    • If specify a meta in a given configuration file:
    • Syntax: USE <metaName>@<filename>

      Example: USE apacheCommon@meta.xml

  2. Excel files: Used when querying Excel files, there are three ways to do this:
    • If the excel file only contains the table on the first sheet:
    • Example: USE excel

    • To point logQL to the top left corner of the table:
    • Example: USE excel('Sheet2!E9')

    • To specify the full range of the table:
    • Example: USE excel(Sheet2!E9:M5007)

    IMPORTANT: All the cells in the row under the header SHOULD be populated. logQL uses this row to identify the field types.

  3. CSV files: It is recommended that you define a meta as described in the section ‘Meta file’ and use this when querying CSV files.
  4. To run queries on the CSV file without defining the meta use the function:

    Syntax: USE csv(<headerLine>)

    Example: USE csv(3)

    USE csv

    Note that <headerLine> is an optional parameter. By default, it assumes the header to be at line 1.

    IMPORTANT: By default, logQL assumes all the fields to be of type string. To know how to change type information, see section ‘Changing types’.

  5. Delimiter files: used when all the fields have a standard delimiter. It is recommended that you define a meta as described in the section ‘Meta file’ and use this meta.
  6. To run queries on these files without defining the meta use the function:

    Syntax: USE sep (<sep>,<headerLine>)

    Example: USE sep( '\t', 4)

    USE sep('\t')

    Note that <headerLine> is an optional parameter. By default, it assumes the header to be at line 1.

    IMPORTANT: By default, logQL assumes all the fields to be of type string. To know how to change type information, see section ‘Changing types’.