Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Splits an array to multiple arrays according to the split indices and packs the generated array in a dynamic array.
Syntax
array_split(array, index)
Learn more about syntax conventions.
Parameters
| Name | Type | Required | Description | 
|---|---|---|---|
| array | dynamic | ✔️ | The array to split. | 
| index | intordynamic | ✔️ | An integer or dynamic array of integers used to indicate the location at which to split the array. The start index of arrays is zero. Negative values are converted to array_length+value. | 
Returns
Returns a dynamic array containing N+1 arrays with the values in the range [0..i1), [i1..i2), ... [iN..array_length) from array, where N is the number of input indices and i1...iN are the indices.
Examples
print arr=dynamic([1,2,3,4,5]) 
| extend arr_split=array_split(arr, 2)
Output
| arr | arr_split | 
|---|---|
| [1,2,3,4,5] | [[1,2],[3,4,5]] | 
print arr=dynamic([1,2,3,4,5]) 
| extend arr_split=array_split(arr, dynamic([1,3]))
Output
| arr | arr_split | 
|---|---|
| [1,2,3,4,5] | [[1],[2,3],[4,5]] |