AQL¶
AQL is a simple query language designed to be used when the standrard filtering (level and service) is not sufficient. AQL statments are written in nested blocks of binary operations. This means that each operator can only have a singular left and singular right argument. In addition, data is retrieved by prepending your logic with a SELECTBY keyword or removed by prepending with a DELETEBY keyword. An example query which gets logs of level INFO and level WARN is as follows:
SELECTBY level = INFO OR level = WARN
If you want to change the ‘OR’ statements to include more than just the two levels, you’ll wrap the first two up in parenthesis and then OR that with a third filter.
SELECTBY ( level = INFO OR level = WARN ) OR level = DEBUG
Filters¶
The various filters that can be used in AQL statements are as follows ( < text like this is a placeholder > )
Filter |
Desrciption |
|---|---|
level = < level > |
Get logs with level |
service = < service > |
Get logs from service |
year = < year > |
Get logs with a timestamp that has the year |
month = < month > |
Get logs with a timestamp that has the month |
day = < day > |
Get logs with a timestamp that has the day |
hour = < hour > |
Get logs with a timestamp that has the hour |
minute = < minute > |
Get logs with a timestamp that has the minute |
second = < second > |
Get logs with a timestamp that has the second |
timestamp = < timestamp > |
Get logs with string timestamp in format |
Operators¶
The various operators are shown below with examples
- AND
< left filter > AND < right filter >Returns logs which satisfy both the left and right filter
- OR
< left filter > OR < right filter >Returns logs which satify the left or right filter
- NOT
< left filter > NOT < right filter >Returns logs from the left filter that are not part of the right filter
- XOR
< left filter > XOR < right filter >Returns logs that are part of the left or right filter but not both
- LIMIT
Limits the results from a filter to
Nlog messages< left filter > LIMIT < N >
- ORDERBY
< left filter > ORDERBY < field >- Orders the results of the left filter in ascending order by one of the following fields
level
service
text
timestamp
year
month
day
hour
minute
second
- ORDERDESC
< left filter > ORDERDESC < field >- Orders the results of the left filter in descending order by one of the following fields
level
service
text
timestamp
year
month
day
hour
minute
second