Closed
Description
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
I wanna sort an array in attribute in ascending or descending order to improve readability and simplify data processing.
Describe the solution you'd like
The Sort() function should accept an input array and return a new array sorted in either ascending or descending order.
Sort(attributes["device.tags"], "asc")
Sort(attributes["device.tags"], "desc")
The function should support sorting arrays of different types, including integers, floats, strings, and booleans. For boolean arrays, elements will be converted to strings for comparison. For arrays containing mixed types (e.g., integers and strings), all elements will be converted to strings for comparison.
Describe alternatives you've considered
No response
Additional context
No response