Skip to main content
The pack_array function in APL creates an array from individual values or expressions. You can use this function to group related data into a single field, which can simplify handling and querying of data collections. It is especially useful when working with nested data structures or aggregating data into arrays for further processing.

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
In Splunk SPL, you typically use functions like mvappend to create multi-value fields. In APL, the pack_array function serves a similar purpose by combining values into an array.
In ANSI SQL, arrays are often constructed using functions like ARRAY. The pack_array function in APL performs a similar operation, creating an array from specified values.

Usage

Syntax

Parameters

Returns

An array containing the specified values in the order they are provided.

Use case example

Use pack_array to consolidate span data into an array for a trace summary. Query
Run in Playground Output This query creates a concise representation of span details.