This page explains how to use the array_slice function in APL.
array_slice
function in APL extracts a subset of elements from an array, based on specified start and end indices. This function is useful when you want to analyze or transform a portion of data within arrays, such as trimming logs, filtering specific events, or working with trace data in OpenTelemetry logs.
Splunk SPL users
mvindex
to extract elements from an array. APL’s array_slice
is similar but more expressive, allowing you to specify slices with optional bounds.ANSI SQL users
array_slice
directly handles arrays, making operations more concise.Parameter | Description |
---|---|
array | The input array to slice. |
start | The starting index of the slice (inclusive). If negative, it is counted from the end of the array. |
end | The ending index of the slice (exclusive). If negative, it is counted from the end of the array. |
events
array, excluding the final one.