Skip to main content
This page shows you how to query your data using APL through a wide range of sample queries. You can try out each example in the Axiom Playground. For an introduction to APL and to the structure of an APL query, see Introduction to APL.

Summarize data

summarize produces a table that aggregates the content of the dataset. Use the aggregation functions with the summarize operator to produce different fields. The following query counts events by time bins.
Run in Playground The example below summarizes the top 10 GitHub push events by maximum push ID.
Run in Playground The example below summarizes the distinct city count by server datacenter.
Run in Playground

Tabular operators

where

where filters the content of the dataset that meets a condition when executed. The following query filters the data by method and content_type:
Run in Playground

count

count returns the number of events from the input dataset.
Run in Playground

project

project selects a subset of fields.
Run in Playground

take

take returns up to the specified number of rows.
Run in Playground

limit

The limit operator is an alias to the take operator.
Run in Playground

Scalar functions

parse_json

parse_json extracts the JSON elements from an array.
Run in Playground

replace_string

replace_string replaces all string matches with another string.
Run in Playground

split

split splits a given string according to a given delimiter and returns a string array.
Run in Playground

strcat_delim

strcat_delim concatenates a string array into a string with a given delimiter.
Run in Playground

indexof

indexof reports the zero-based index of the first occurrence of a specified string within the input string.
Run in Playground

Regex examples

Remove leading characters
Run in Playground Find logs from a city
Run in Playground Identify logs from a user agent
Run in Playground Find logs with response body size in a certain range
Run in Playground Find logs with user agents containing Windows NT
Run in Playground Find logs with specific response header size
Run in Playground Find logs with specific request duration
Run in Playground Find logs where TLS is enabled and method is POST
Run in Playground

Array functions

array_concat

array_concat concatenates a number of dynamic arrays to a single array.
Run in Playground

array_sum

array_sum calculates the sum of elements in a dynamic array.
Run in Playground

Conversion functions

todatetime

todatetime converts input to datetime scalar.
Run in Playground

dynamic_to_json

dynamic_to_json converts a scalar value of type dynamic to a canonical string representation.
Run in Playground

Scalar operators

APL supports a wide range of scalar operators:

contains

The query below uses the contains operator to find the strings that contain the string -bot and [bot]:
Run in Playground
Run in Playground

Hash functions

  • hash_md5 returns an MD5 hash value for the input value.
  • hash_sha256 returns a sha256 hash value for the input value.
  • hash_sha1 returns a sha1 hash value for the input value.
Run in Playground

Rounding functions

  • floor() calculates the largest integer less than, or equal to, the specified numeric expression.
  • ceiling() calculates the smallest integer greater than, or equal to, the specified numeric expression.
  • bin() rounds values down to an integer multiple of a given bin size.
Run in Playground Truncate decimals using round function
Run in Playground Truncate decimals using floor function
Run in Playground

Other examples

List all unique groups
Run in Playground Count of all events per service
Run in Playground Change the time clause
Run in Playground HTTP 5xx responses for the last 7 days, one bar per day
Run in Playground Implement a remapper on remote address logs
Run in Playground Advanced aggregations
Run in Playground Search map fields
Run in Playground Configure processing rules
Run in Playground Return different values based on the evaluation of a condition
Run in Playground Working with different operators
Run in Playground
Run in Playground Get the JSON into a property bag using parse-json
Get average response using project-keep
Run in Playground Combine multiple percentiles into a single chart
Run in Playground Combine mathematical functions
Run in Playground
Run in Playground Change global configuration attributes
Run in Playground Set defualt value on event field
Run in Playground Extract nested payment amount from custom attributes map field
Run in Playground Filtering GitHub issues by label identifier
Run in Playground Aggregate trace counts by HTTP method attribute in custom map
Run in Playground