Skip to content

Commit ceed513

Browse files
authored
Improve onboarding pages for ingesting and querying (#258)
1 parent 52d18e4 commit ceed513

File tree

7 files changed

+663
-739
lines changed

7 files changed

+663
-739
lines changed

apl/entities/entity-names.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ Quote an identifier in your APL query if any of the following is true:
3636
- Dash (`-`)
3737
- The identifier name is identical to one of the reserved keywords of the APL query language. For example, `project` or `where`.
3838

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']`.
4040

4141
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.

apl/introduction.mdx

Lines changed: 67 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,92 @@ icon: door-open
66
tags: ['axiom documentation', 'documentation', 'axiom', 'APL', 'axiom processing language', 'data explorer', 'getiing started guide', 'summarize', 'filter']
77
---
88

9-
## Introduction
9+
import Prerequisites from "/snippets/minimal-prerequisites.mdx"
1010

1111
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.
1212

13-
## Get started
13+
<Prerequisites />
1414

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
1616

17-
## APL query structure
17+
APL queries consist of the following:
1818

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.
2021

21-
APL query has the following structure:
22+
Delimit operators with the pipe character (`|`).
23+
24+
A typical APL query has the following structure:
2225

2326
```kusto
24-
DataSource
25-
| operator ...
26-
| operator ...
27+
DatasetName
28+
| Operator ...
29+
| Operator ...
2730
```
2831

29-
Where:
32+
- `DatasetName` is the name of the dataset you want to query.
33+
- `Operator` is an operation you apply to the data.
3034

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>
3340

34-
Let’s look at an example query.
41+
## Example query
3542

3643
```kusto
3744
['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
4047
| summarize count() by bin_auto(_time), actor
4148
```
4249

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).
4489

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
4691

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:
4993

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.
94+
- [Scalar functions](/apl/scalar-functions/)
95+
- [Aggregation functions](/apl/aggregation-function/)
96+
- [Tabular operators](/apl/tabular-operators/)
97+
- [Scalar operators](/apl/scalar-operators/)

0 commit comments

Comments
 (0)