This page explains how to use the base64_decode_toarray function in APL.
base64_decode_toarray
function to decode a Base64-encoded string into an array of bytes. This is especially useful when you need to extract raw binary data from encoded inputs, such as network payloads, authentication tokens, or structured log fields. You can then transform or analyze the resulting byte array using additional APL functions like array_slice
, array_length
, or array_index
.
This function is useful in scenarios where logs or telemetry data include fields that store binary data encoded as Base64, which is common for compact transmission or obfuscation. By decoding these values into byte arrays, you gain visibility into the underlying structure of the data.
Splunk SPL users
eval
with the base64decode
function, which returns a string. If you need a byte array representation, you must manually transform it. In APL, base64_decode_toarray
directly produces an array of bytes, allowing you to work with binary data more precisely.ANSI SQL users
VARBINARY
if the engine supports it. APL provides a built-in function that directly yields an array of integers representing bytes.Name | Type | Required | Description |
---|---|---|---|
base64_input | string | ✔️ | A Base64-encoded string. |
raw |
---|
[104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100] |
'aGVsbG8gd29ybGQ='
, which represents the ASCII string "hello world"
, into an array of byte values.