Explore how to use APL in Axiom’s Query tab to run queries using Tabular Operators, Scalar Functions, and Aggregation Functions.
In this tutorial, you’ll explore how to use APL in Axiom’s Query tab to run queries using Tabular Operators, Scalar Functions, and Aggregation Functions.
Every query, starts with a dataset embedded in square brackets, with the starting expression being a tabular operator statement. The query’s tabular expression statements produce the results of the query.Before you can start writing tabular operators or any function, the pipe (|) delimiter starts the query statements as they flow from one function to another.
To run queries on each function or operator in this tutorial, click the Run in Playground button.summarize: Produces a table that aggregates the content of the dataset.The following query returns the count of events by time
Copy
Ask AI
['github-push-event']| summarize count() by bin_auto(_time)
['github-issue-comment-event']| extend bot = actor contains "-bot" or actor contains "[bot]"| where bot == true| summarize count() by bin_auto(_time), actor| take 20
HTTP 5xx responses (day wise) for the last 7 days - one bar per day
Copy
Ask AI
['sample-http-logs']| where _time > ago(7d)| where req_duration_ms >= 5 and req_duration_ms < 6| summarize count(), histogram(resp_header_size_bytes, 20) by bin(_time, 1d)| order by _time desc
['hn']| extend superman = text contains "superman" or title contains "superman"| extend batman = text contains "batman" or title contains "batman"| extend hero = case( superman and batman, "both", superman, "superman ", // spaces change the color batman, "batman ", "none")| where (superman or batman) and not (batman and superman)| summarize count(), topk(type, 3) by bin(_time, 30d), hero| take 10
['github-issues-event']| where actor !endswith "[bot]"| where repo startswith "kubernetes/"| where action == "opened"| summarize count() by bin_auto(_time)
['sample-http-logs']| project status = case( isnotnull(status) and status != "", content_type, // use the contenttype if it’s not null and not an empty string "info" // default value )