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
Rotates values inside a dynamic
array to the left.
array_rotate_left(
array, rotate_count)
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
array | dynamic |
✔️ | The array to rotate. |
rotate_count | integer | ✔️ | The number of positions that array elements will be rotated to the left. If the value is negative, the elements will be rotated to the right. |
Dynamic array containing the same elements as the original array with each element rotated according to rotate_count.
Rotating to the left by two positions:
print arr=dynamic([1,2,3,4,5])
| extend arr_rotated=array_rotate_left(arr, 2)
Output
arr | arr_rotated |
---|---|
[1,2,3,4,5] | [3,4,5,1,2] |
Rotating to the right by two positions by using negative rotate_count value:
print arr=dynamic([1,2,3,4,5])
| extend arr_rotated=array_rotate_left(arr, -2)
Output
arr | arr_rotated |
---|---|
[1,2,3,4,5] | [4,5,1,2,3] |
- To rotate an array to the right, use array_rotate_right().
- To shift an array to the left, use array_shift_left().
- To shift an array to the right, use array_shift_right()