import Prerequisites from "/snippets/minimal-prerequisites.mdx"
The Axiom Processing Language (APL) is a query language that’s perfect for getting deeper insights from your data. Whether logs, events, analytics, or similar, APL provides the flexibility to filter, manipulate, and summarize your data exactly the way you need it.
Build an APL query
APL queries consist of the following:
- Data source: The most common data source is one of your Axiom datasets.
- Operators: Operators filter, manipulate, and summarize your data.
Delimit operators with the pipe character (|).
A typical APL query has the following structure:
DatasetName
| Operator ...
| Operator ...DatasetNameis the name of the dataset you want to query.Operatoris an operation you apply to the data.
Example query
['github-issue-comment-event']
| extend isBot = actor contains '-bot' or actor contains '[bot]'
| where isBot == true
| summarize count() by bin_auto(_time), actorThe query above uses a dataset called github-issue-comment-event as its data source. It uses the following operators:
- extend adds a new field
isBotto the query results. It sets the values of the new field to true if the values of theactorfield in the original dataset contain-botor[bot]. - where filters for the values of the
isBotfield. It only returns rows where the value is true. - summarize aggregates the data and produces a chart.
Each operator is separated using the pipe character (|).
Example result
As a result, the query returns a chart and a table. The table counts the different values of the actor field where isBot is true, and the chart displays the distribution of these counts over time.
| actor | count_ |
|---|---|
| github-actions[bot] | 487 |
| sonarqubecloud[bot] | 208 |
| dependabot[bot] | 148 |
| vercel[bot] | 91 |
| codecov[bot] | 63 |
| openshift-ci[bot] | 52 |
| coderabbitai[bot] | 43 |
| netlify[bot] | 37 |
Quote dataset and field names
If the name of a dataset or field contains at least one of the following special characters, quote the name in your APL query:
- Space ( )
- Dot (.)
- Dash (-)
To quote the dataset or field in your APL query, enclose its name with quotation marks (' or ") and square brackets ([]). For example, ['my-field'].
For more information on rules about naming and quoting entities, see Entity names.
What’s next
Check out the list of example queries or explore the supported operators and functions: