Query Multiple Files
From: This is used to select the files to query on. You can query a single file or multiple files:
- Single file:
- Comma separated:
- Wild card:
- Single zip file:
- Wild card file name:
- Wild card zip files:
Syntax: FROM <filename>.
Example: FROM account.xls
Syntax: FROM <fileName1>, <fileName2>
Example: FROM account.xls, ./old/nov-account.xls, ./old/oct-account.xls
Syntax: FROM <partialName>*.xls
Example: FROM ./old/*-account-2007.xls
Example: FROM ./old/*-account-*.xls
Syntax: FROM <fileName>@<zipFileName>
Example: FROM jon-nov-2007.xls@emp-expenses.zip
Example: FROM jon-*-2007.xls@emp-expenses.zip
Example: FROM jon.xls@*-expenses.zip
Use: Specify the Meta to use when reading the data file.
- 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:
- If specify a meta in a given configuration file:
- 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:
- To point logQL to the top left corner of the table:
- To specify the full range of the table:
- CSV files: It is recommended that you define a meta as described in the section ‘Meta file’ and use this when querying CSV files.
- 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.
Syntax: USE <metafile>
Example: USE ./meta/apacheConfig.xml
Syntax: USE <metaName>@<filename>
Example: USE apacheCommon@meta.xml
Example: USE excel
Example: USE excel('Sheet2!E9')
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.
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’.
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’.