This page explains how to use the array_length function in APL.
array_length
function in APL (Axiom Processing Language) returns the length of an array. You can use this function to analyze and filter data by array size, such as identifying log entries with specific numbers of entries or events with multiple tags. This function is useful for analyzing structured data fields that contain arrays, such as lists of error codes, tags, or IP addresses.
Splunk SPL users
mvcount
function to determine the length of a multivalue field. In APL, array_length
serves the same purpose by returning the size of an array within a column.ANSI SQL users
CARDINALITY
or ARRAY_LENGTH
(in databases that support arrays) to get the length of an array. In APL, the array_length
function is straightforward and works directly with array fields in any dataset.array_length
can reveal the number of events associated with a span.
Query
_time | trace_id | span_id | service.name | event_count |
---|---|---|---|---|
2024-10-28T12:30:00 | trace_abc123 | span_001 | frontend | 3 |