-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Labels
Staleclosed as inactiveenhancementNew feature or requestNew feature or requestpkg/ottlwaiting-for-code-owners
Description
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
Currently, OTTL does not have a function to sub-slice a slice with a given start and end indices slice[start:end]
.
Describe the solution you'd like
-
Add
SubSlice(target, start, end)
converter and returns a new slice.
target
: any type of slice
start
: the starting index of the sublist (inclusive)
end
: the ending index of the sublist (exclusive) -
Support Go's slice expressions syntax in ottl
target[start:end]
target[:end]
target[start:]
Following go slice expression,start
andend
can not be negative integer
Supporting (1) would be very helpful, (2) is cool to have it.
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
Staleclosed as inactiveenhancementNew feature or requestNew feature or requestpkg/ottlwaiting-for-code-owners