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.
In this article
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.
array_split
(array, index)
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
array | dynamic |
✔️ | The array to split. |
index | int or dynamic |
✔️ | 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 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.
This following example shows how to split and array.
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]] |