filter processor include rather than drop #41191
Replies: 1 comment
-
AFAIK, the old configuration style is still available (at least for now). It was removed from the docs (#31722) to prioritize the OTTL configuration style, but it should still be working with the latest collector versions. The OTTL style should also be simple to use, for example, your config: filter/regexp:
logs:
include:
match_type: regexp
resource_attributes:
- key: host.name
value: prefix.* Can be translated to the OTTL condition Include: filter/regexp:
logs:
log_record:
- not IsMatch(resource.attributes["host.name"], "prefix.*") exclude: filter/regexp:
logs:
log_record:
- IsMatch(resource.attributes["host.name"], "prefix.*") Here you can see the old style vs new style in action for the include use-case. Multiple conditions are evaluated using the logs:
log_record:
- not(
HasPrefix(resource.attributes["host.name"], "prefix.") or
HasPrefix(resource.attributes["host.name"], "another.")
) Hope that helps :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In older versions of the filter processor there was the ability to define the behavior as include or exclude
For example, only include logs that match the regex
versus exclude logs that match the regex
However this has been deprecated and no longer available. The current filter processor only drops logs on match.
Sometimes writing the OpenTelemetry Transformation Language condition to exclude all logs EXCEPT a few particular conditions is difficult. It would be simpler to write the include logic.
Is it possible to achieve the include behavior like in older filter processors?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions