This page explains how to use the array_split function in APL.
The array_split
function in APL splits an array into smaller subarrays based on specified split indices and packs the generated subarrays into a dynamic array. This function is useful when you want to partition data for analysis, batch processing, or distributing workloads across smaller units.
You can use array_split
to:
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Splunk SPL users
In Splunk SPL, array manipulation is achieved through functions like mvzip
and mvfilter
, but there is no direct equivalent to array_split
. APL provides a more explicit approach for splitting arrays.
ANSI SQL users
ANSI SQL does not have built-in functions for directly splitting arrays. APL provides this capability natively, making it easier to handle array operations within queries.
Parameter | Description | Type |
---|---|---|
array | The array to split. | Dynamic |
index | An integer or dynamic array of integers. These zero-based split indices indicate the location at which to split the array. | Integer or Dynamic |
Returns a dynamic array containing N+1 arrays where N is the number of input indices. The original array is split at the input indices.
Split large event arrays into manageable chunks for analysis.
Output
This query splits the events
array at index 2
into two subarrays for further processing.
Divide traces into fixed-size segments for better debugging.
Query
Output
This query splits the events
array into three subarrays based on the indices [1,2]
.
This page explains how to use the array_split function in APL.
The array_split
function in APL splits an array into smaller subarrays based on specified split indices and packs the generated subarrays into a dynamic array. This function is useful when you want to partition data for analysis, batch processing, or distributing workloads across smaller units.
You can use array_split
to:
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Splunk SPL users
In Splunk SPL, array manipulation is achieved through functions like mvzip
and mvfilter
, but there is no direct equivalent to array_split
. APL provides a more explicit approach for splitting arrays.
ANSI SQL users
ANSI SQL does not have built-in functions for directly splitting arrays. APL provides this capability natively, making it easier to handle array operations within queries.
Parameter | Description | Type |
---|---|---|
array | The array to split. | Dynamic |
index | An integer or dynamic array of integers. These zero-based split indices indicate the location at which to split the array. | Integer or Dynamic |
Returns a dynamic array containing N+1 arrays where N is the number of input indices. The original array is split at the input indices.
Split large event arrays into manageable chunks for analysis.
Output
This query splits the events
array at index 2
into two subarrays for further processing.
Divide traces into fixed-size segments for better debugging.
Query
Output
This query splits the events
array into three subarrays based on the indices [1,2]
.