This page explains how to use the pack_dictionary function in APL.
pack_dictionary
function in APL to construct a dynamic property bag (dictionary) from a list of keys and values. The resulting dictionary maps each specified key to its corresponding value and allows you to store key-value pairs in a single column for downstream operations like serialization, custom grouping, or structured export.
pack_dictionary
is especially useful when you want to:
Splunk SPL users
pack_dictionary
, you can simulate similar behavior using the eval
command and mvzip
or mvmap
to construct composite objects. In APL, pack_dictionary
is a simpler and more declarative way to produce key-value structures inline.ANSI SQL users
jsonb_build_object
). In contrast, APL provides a native and type-safe way to construct dictionaries using pack_dictionary
.Name | Type | Description |
---|---|---|
keyN | string | A constant string that represents a dictionary key. |
valueN | scalar | A scalar value to associate with the corresponding key. |
pack_dictionary
to store request metadata in a compact format for structured inspection or export.Query_time | id | request_info |
---|---|---|
2025-06-18T14:35:00Z | user42 | { "method": "GET", "uri": "/home", "status": "200", "duration": 82 } |
request_info
column that contains key HTTP request data as a dictionary, simplifying downstream analysis or visualization.pack_array
when you don’t need named keys and want positional data instead.pack_dictionary
.pack_dictionary
.