You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apl/entities/entity-names.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,6 @@ Quote an identifier in your APL query if any of the following is true:
36
36
- Dash (`-`)
37
37
- The identifier name is identical to one of the reserved keywords of the APL query language. For example, `project` or `where`.
38
38
39
-
If any of the above is true, you must quote the identifier by putting it in quotation marks (`'` or `"`) and square brackets (`[]`). For example, `['my-field']`.
39
+
If any of the above is true, you must quote the identifier by enclosing it in quotation marks (`'` or `"`) and square brackets (`[]`). For example, `['my-field']`.
40
40
41
41
If none of the above is true, you don’t need to quote the identifier in your APL query. For example, `myfield`. In this case, quoting the identifier name is optional.
The Axiom Processing Language (APL) is a query language that is 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.
12
12
13
-
## Get started
13
+
<Prerequisites />
14
14
15
-
Go to the Query tab and click one of your datasets to get started. The APL editor has full auto-completion so you can poke around or you can get a better understanding of all the features by using the reference menu to the left of this page.
15
+
## Build an APL query
16
16
17
-
## APL query structure
17
+
APL queries consist of the following:
18
18
19
-
At a minimum, a query consists of source data reference (name of a dataset) and zero or more query operators applied in sequence. Individual operators are delimited using the pipe character (`|`).
19
+
-**Data source:** The most common data source is one of your Axiom datasets.
20
+
-**Operators:** Operators filter, manipulate, and summarize your data.
20
21
21
-
APL query has the following structure:
22
+
Delimit operators with the pipe character (`|`).
23
+
24
+
A typical APL query has the following structure:
22
25
23
26
```kusto
24
-
DataSource
25
-
| operator ...
26
-
| operator ...
27
+
DatasetName
28
+
| Operator ...
29
+
| Operator ...
27
30
```
28
31
29
-
Where:
32
+
-`DatasetName` is the name of the dataset you want to query.
33
+
-`Operator` is an operation you apply to the data.
30
34
31
-
- DataSource is the name of the dataset you want to query
32
-
- Operator is a function that will be applied to the data
35
+
<Note>
36
+
Apart from Axiom datasets, you can use other data sources:
37
+
- External data sources using the [externaldata](/apl/tabular-operators/externaldata-operator) operator.
38
+
- Specify a data table in the APL query itself using the `let` statement.
39
+
</Note>
33
40
34
-
Let’s look at an example query.
41
+
## Example query
35
42
36
43
```kusto
37
44
['github-issue-comment-event']
38
-
| extend bot = actor contains "-bot" or actor contains "[bot]"
39
-
| where bot == true
45
+
| extend isBot = actor contains '-bot' or actor contains '[bot]'
46
+
| where isBot == true
40
47
| summarize count() by bin_auto(_time), actor
41
48
```
42
49
43
-
The query above begins with reference to a dataset called **github-issue-comment-event** and contains several operators, [extend](/apl/tabular-operators/extend-operator), [where](/apl/tabular-operators/where-operator), and [summarize](/apl/tabular-operators/summarize-operator), each separated by a `pipe`. The extend operator creates the **bot** column in the returned result, and sets its values depending on the value of the actor column, the **where** operator filters out the value of the **bot** to a branch of rows and then produce a chart from the aggregation using the **summarize** operator.
50
+
[Run in Playground](https://play.axiom.co/axiom-play-qf1k/query?initForm=%7B%22apl%22%3A%22%5B'github-issue-comment-event'%5D%20%7C%20extend%20isBot%20%3D%20actor%20contains%20'-bot'%20or%20actor%20contains%20'%5Bbot%5D'%20%7C%20where%20isBot%20%3D%3D%20true%20%7C%20summarize%20count()%20by%20bin_auto(_time)%2C%20actor%22%7D)
51
+
52
+
The query above uses a dataset called `github-issue-comment-event` as its data source. It uses the follwing operators:
53
+
54
+
-[extend](/apl/tabular-operators/extend-operator) adds a new field `isBot` to the query results. It sets the values of the new field to true if the values of the `actor` field in the original dataset contain `-bot` or `[bot]`.
55
+
-[where](/apl/tabular-operators/where-operator) filters for the values of the `isBot` field. It only returns rows where the value is true.
56
+
-[summarize](/apl/tabular-operators/summarize-operator) aggregates the data and produces a chart.
57
+
58
+
Each operator is separated using the pipe character (`|`).
59
+
60
+
## Example result
61
+
62
+
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.
63
+
64
+
| actor | count_|
65
+
|---------------------|--------|
66
+
| github-actions[bot]| 487 |
67
+
| sonarqubecloud[bot]| 208 |
68
+
| dependabot[bot]| 148 |
69
+
| vercel[bot]| 91 |
70
+
| codecov[bot]| 63 |
71
+
| openshift-ci[bot]| 52 |
72
+
| coderabbitai[bot]| 43 |
73
+
| netlify[bot]| 37 |
74
+
75
+
<Note>
76
+
The query results are a representation of your data based on your request. The query doesn’t change the original dataset.
77
+
</Note>
78
+
79
+
## Quote dataset and field names
80
+
81
+
If the name of a dataset or field contains at least one of the following special characters, quote the name in your APL query:
82
+
- Space (``)
83
+
- Dot (`.`)
84
+
- Dash (`-`)
85
+
86
+
To quote the dataset or field in your APL query, enclose its name with quotation marks (`'` or `"`) and square brackets (`[]`). For example, `['my-field']`.
87
+
88
+
For more information on rules about naming and quoting entities, see [Entity names](/apl/entities/entity-names).
44
89
45
-
The most common kind of query statement is a tabular expression statement. Tabular statements contain operators, each of which starts with a tabular `input` and returns a tabular `output.`
90
+
## What's next
46
91
47
-
- Explore the [tabular operators](/apl/tabular-operators/extend-operator) we support.
48
-
- Check out our [entity names and identifier naming rules](/apl/entities/entity-names).
92
+
Check out the [list of sample queries](/apl/tutorial) or explore the supported operators and functions:
49
93
50
-
Axiom Processing Language supplies a set of system [data types](/apl/data-types/scalar-data-types) that define all the types of [data](/apl/data-types/null-values) that can be used with Axiom Processing Language.
0 commit comments