[pkg/ottl] Allow indexing maps and slices with dynamic values #36644
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
pkg/ottl
priority:p2
Medium
Component(s)
processor/transform
Is your feature request related to a problem? Please describe.
I want to set a new key-value pair attribute using the value of another attribute
Option 1
Option 2
When I use option 1 got error
2024/12/02 14:53:40 collector server run finished with error: invalid configuration: processors::transform/combine_scope_type_and_scope_value: unable to parse OTTL statement "set(attributes[attributes[\"scope.type\"]], attributes[\"scope.value\"]) where attributes[\"scope.type\"] != nil and attributes[\"scope.value\"] != nil": statement has invalid syntax: 1:15: unexpected token "[" (expected ")" Key*)
Alternative is
But I also have error
The final effect should be
scope.type = enviroment
scope.value = dev
And addition new key-value which will be combination of scope.type and scope.value
enviroment = dev
Describe the solution you'd like
See up
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: