-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pkg/ottl] Allow checking path type #22161
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This would be fairly easy by adding Converters that use a typed Getter to return whether the Getter throws an error for the path. Checking whether a body is a map could then look like:
An alternative approach could be a |
Agreed. Also providing more type converters, like Also an ErrorMode that ignores the warnings and doesn't log anything could be nice. |
I think we should proceed with caution on this one, but that could be good if we can articulate when to use it. I've opened an issue for further discussion here: #22743. |
@evan-bradley for the type checking function, do you think it should consider literal |
I think sticking to whatever passes the |
Agreed, I think we should probably be treating them the same within OTTL. I'll submit a separate PR to update |
Component(s)
internal/filter, processor/transform
Is your feature request related to a problem? Please describe.
I have a log pipeline where I consume logs of different formats. The log body may be of few forms:
When the log is not a pure string I would like to move data to attributes. Currently I do this with the
transformprocessor
as follows:This seems to work ok but I get one of the following warnings depending on whether body is a
kvlistValue
or astringValue
or
Describe the solution you'd like
I would like a way to determine the type of an object in the transform processor. Something like the following
Describe alternatives you've considered
No response
Additional context
The problem is written specific to my use case but it might apply more generally.
The text was updated successfully, but these errors were encountered: