Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Introduction

Query reference overview

APL

IntroductionSample queriesAll features
Functions
Scalar functions
Array functions
Overview
array_concat
array_extract
array_iff
array_index_of
array_length
array_reverse
array_rotate_left
array_rotate_right
array_select_dict
array_shift_left
array_shift_right
array_slice
array_sort_asc
array_sort_desc
array_split
array_sum
bag_has_key
bag_keys
bag_pack
bag_zip
isarray
len
pack_array
pack_dictionary
strcat_array
Conditional functions
Overview
case
iff
Conversion functions
Overview
dynamic_to_json
ensure_field
isbool
toarray
tobool
todatetime
todouble, toreal
todynamic
tohex
toint, tolong
tostring
totimespan
Datetime functions
Overview
ago
datetime_add
datetime_diff
datetime_part
dayofmonth
dayofweek
dayofyear
endofday
endofmonth
endofweek
endofyear
getmonth
getyear
hourofday
monthofyear
now
startofday
startofmonth
startofweek
startofyear
unixtime_microseconds_todatetime
unixtime_milliseconds_todatetime
unixtime_nanoseconds_todatetime
unixtime_seconds_todatetime
week_of_year
GenAI functions
Overview
genai_concat_contents
genai_conversation_turns
genai_cost
genai_estimate_tokens
genai_extract_assistant_response
genai_extract_function_results
genai_extract_system_prompt
genai_extract_tool_calls
genai_extract_user_prompt
genai_get_content_by_index
genai_get_content_by_role
genai_get_pricing
genai_get_role
genai_has_tool_calls
genai_input_cost
genai_is_truncated
genai_message_roles
genai_output_cost
Hash functions
Overview
hash
hash_md5
hash_sha1
hash_sha256
hash_sha512
IP functions
Overview
format_ipv4
format_ipv4_mask
geo_info_from_ip_address
has_any_ipv4
has_any_ipv4_prefix
has_ipv4
has_ipv4_prefix
ipv4_compare
ipv4_is_in_range
ipv4_is_in_any_range
ipv4_is_match
ipv4_is_private
ipv4_netmask_suffix
ipv6_compare
ipv6_is_in_any_range
ipv6_is_in_range
ipv6_is_match
parse_ipv4
parse_ipv4_mask
Mathematical functions
Overview
abs
acos
asin
atan
atan2
cos
cot
degrees
exp
exp2
exp10
gamma
isfinite
isinf
isint
isnan
log
log2
log10
loggamma
max_of
min_of
not
pi
pow
radians
rand
range
round
set_difference
set_has_element
set_intersect
set_union
sign
sin
sqrt
tan
Metadata functions
Overview
column_ifexists
cursor_current
ingestion_time
Pair functions
Overview
find_pair
pair
parse_pair
Rounding functions
Overview
bin
bin_auto
ceiling
floor
String functions
Overview
base64_decode_toarray
base64_decode_tostring
base64_encode_fromarray
base64_encode_tostring
coalesce
countof
countof_regex
extract
extract_all
format_bytes
format_url
gettype
indexof
indexof_regex
isascii
isempty
isnotempty
isnotnull
isnull
parse_bytes
parse_csv
parse_json
parse_path
parse_url
parse_urlquery
quote
regex_quote
replace
replace_regex
replace_string
reverse
split
strcat
strcat_delim
strcmp
string_size
strlen
strrep
strip_ansi_escapes
substring
tolower
totitle
toupper
translate
trim
trim_end
trim_end_regex
trim_regex
trim_space
trim_start
trim_start_regex
unicode_codepoints_from_string
unicode_codepoints_to_string
url_decode
url_encode
SQL functions
Overview
parse_sql
format_sql
Time series functions
Overview
series_abs
series_acos
series_add
series_asin
series_atan
series_ceiling
series_cos
series_cosine_similarity
series_divide
series_dot_product
series_equals
series_exp
series_fft
series_fill_backward
series_fill_const
series_fill_forward
series_fill_linear
series_fir
series_floor
series_greater
series_greater_equals
series_ifft
series_iir
series_less
series_less_equals
series_log
series_magnitude
series_max
series_min
series_multiply
series_not_equals
series_pearson_correlation
series_pow
series_sign
series_sin
series_stats
series_stats_dynamic
series_subtract
series_sum
series_tan
Type functions
Overview
isimei
ismap
isreal
iscc
isstring
isutf8
Aggregation functions
Overview
arg_min
arg_max
avg
avgif
count
countif
dcount
dcountif
histogram
histogramif
make_list
make_list_if
make_set
make_set_if
max
maxif
min
minif
percentile
percentileif
percentiles_array
percentiles_arrayif
phrases
rate
spotlight
stdev
stdevif
sum
sumif
topk
topkif
variance
varianceif
Operators
Tabular operators
Overview
count
distinct
extend
extend-valid
externaldata
getschema
join
limit
lookup
make-series
mv-expand
order
parse
parse-kv
parse-where
project
project-away
project-keep
project-rename
project-reorder
redact
sample
search
sort
summarize
take
top
union
where
Scalar operators
Set membership operators
Overview
in
!in
in~
!in~
Logical
Numerical
String
Reference
Entity names
Map fields
Null values
Scalar data types
Set statement
Special field attributes
Migrate
Splunk SPL
SQL
Sumo Logic

MPL

Language featuresSample queriesMigrate
APL/Reference

Special field attributes

This page explains how to implement special fields within APL queries to enhance the functionality and interactivity of datasets. Use these fields in APL queries to add unique behaviors to the Axiom user interface.

Add link to table

  • Name: _row_url
  • Type: string
  • Description: Define the URL to which the entire table links.
  • APL query example: extend _row_url = 'https://axiom.co/'
  • Expected behavior: Make rows clickable. When clicked, go to the specified URL.

If you specify a static string as the URL, all rows link to that page. To specify a different URL for each row, use an dynamic expression like extend _row_url = strcat('https://axiom.co/', uri) where uri is a field in your data.

Add link to values in a field

  • Name: _FIELDNAME_url
  • Type: string
  • Description: Define a URL to which values in a field link.
  • APL query example: extend _website_url = 'https://axiom.co/'
  • Expected behavior: Make values in the website field clickable. When clicked, go to the specified URL.

Replace FIELDNAME with the actual name of the field.

Add tooltip to values in a field

  • Name: _FIELDNAME_tooltip
  • Type: string
  • Description: Define text to be displayed when hovering over values in a field.
  • Example Usage: extend _errors_tooltip = 'Number of errors'
  • Expected behavior: Display a tooltip with the specified text when the user hovers over values in a field.

Replace FIELDNAME with the actual name of the field.

Add description to values in a field

  • Name: _FIELDNAME_description
  • Type: string
  • Description: Define additional information to be displayed under the values in a field.
  • Example Usage: extend _diskusage_description = 'Current disk usage'
  • Expected behavior: Display additional text under the values in a field for more context.

Replace FIELDNAME with the actual name of the field.

Add unit of measurement

  • Name: _FIELDNAME_unit
  • Type: string
  • Description: Specify the unit of measurement for another field’s value allowing for proper formatting and display.
  • APL query example: extend _size_unit = "gbytes"
  • Expected behavior: Format the value in the size field according to the unit specified in the _size_unit field.

Replace FIELDNAME with the actual name of the field you want to format. For example, for a field named size, use _size_unit = "gbytes" to display its values in gigabytes in the query results.

The supported units are the following:

Percentage

Unit nameAPL sytax
percent (0-100)percent100
percent (0.0-1.0)percent

Currency

Unit nameAPL sytax
Dollars ($)curusd
Pounds (£)curgbp
Euro (€)cureur
Bitcoin (฿)curbtc

Data (IEC)

Unit nameAPL sytax
bits(IEC)bits
bytes(IEC)bytes
kibibyteskbytes
mebibytesmbytes
gibibytesgbytes
tebibytestbytes
pebibytespbytes

Data (metric)

Unit nameAPL sytax
bits(Metric)decbits
bytes(Metric)decbytes
kilobytesdeckbytes
megabytesdecmbytes
gigabytesdecgbytes
terabytesdectbytes
petabytesdecpbytes

Data rate

Unit nameAPL sytax
packets/secpps
bits/secbps
bytes/secBps
kilobytes/secKBs
kilobits/secKbits
megabytes/secMBs
megabits/secMbits
gigabytes/secGBs
gigabits/secGbits
terabytes/secTBs
terabits/secTbits
petabytes/secPBs
petabits/secPbits

Datetime

Unit nameAPL sytax
Hertz (1/s)hertz
nanoseconds (ns)ns
microseconds (µs)µs
milliseconds (ms)ms
seconds (s)secs
minutes (m)mins
hours (h)hours
days (d)days
agoago

Throughput

Unit nameAPL sytax
counts/sec (cps)cps
ops/sec (ops)ops
requests/sec (rps)reqps
reads/sec (rps)rps
writes/sec (wps)wps
I/O ops/sec (iops)iops
counts/min (cpm)cpm
ops/min (opm)opm
requests/min (rps)reqpm
reads/min (rpm)rpm
writes/min (wpm)wpm

Example

The example APL query below adds a tooltip and a description to the values of the status field. Clicking one of the values in this field leads to a page about status codes. The query adds the new field resp_body_size_bits that displays the size of the response body in the unit of bits.

APLRun in Playground
['sample-http-logs']
| extend _status_tooltip = 'The status of the HTTP request is the response code from the server. It shows if an HTTP request has been successfully completed.'
| extend _status_description = 'This is the status of the HTTP request.'
| extend _status_url = 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Status'
| extend resp_body_size_bits = resp_body_size_bytes * 8
| extend _resp_body_size_bits_unit = 'bits'
Was this page helpful?
Suggest edits on GitHub
PreviousSet statementNextMigrate from Splunk SPL to APL
On this page
Add link to tableAdd link to values in a fieldAdd tooltip to values in a fieldAdd description to values in a fieldAdd unit of measurementExample