This page explains how to use the len function in APL.
len
function in APL (Axiom Processing Language) to determine the length of a string or the number of elements in an array. This function is useful when you want to filter, sort, or analyze data based on the size of a value—whether that’s the number of characters in a request URL or the number of cities associated with a user.
Use len
when you need to:
Splunk SPL users
len
function within eval
or where
expressions to determine string length or array size. In APL, len
works similarly, but is used as a standalone scalar function.ANSI SQL users
LENGTH()
for strings and CARDINALITY()
for arrays. In APL, len
handles both cases—string and array—depending on the input type.Name | Type | Description |
---|---|---|
value | string or array | The input to measure—either a string or an array. |
value
is a string, returns the number of characters.value
is an array, returns the number of elements.null
if the input is null
.len
to find requests with long URIs, which might indicate poorly designed endpoints or potential abuse.Query_time | id | uri | uri_length |
---|---|---|---|
2025-06-18T12:34:00Z | user123 | /api/products/search?query=… | 132 |
2025-06-18T12:35:00Z | user456 | /download/file/very/long/path/… | 141 |
array_extract
, but supports negative indexing.array_extract
.