-
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
Logs Filter by Attributes in Its Json Body #31375
Comments
Pinging code owners for processor/filter: @TylerHelmuth @boostchicken. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@DevProJSSV what does your log look like inside the collector? Is that message all in the log body as a map or string? You can use the debug exporter with |
Hello @TylerHelmuth I just updated my description with more details. I hope the screen captures can help. Thank you for the help. |
This is what I can see in body @TylerHelmuth |
Your body is a string so you can't do |
Hello @TylerHelmuth thank you so much for your suggestions.
I tested all of the scenarios you suggested and some others based on your response but I am still not able to see the expected result. Here I summarize the tests : Log sample from opentelemetry output:
Test # 1 :
Result: Error
Test # 2 :
Result:
Test # 3 :
Results: No errors but is not match anything as we do not get any log in the Splunk platform:
Thank you so much in advance for any suggestions based on the logs. |
For test 3, if there is a match the data is dropped, so I wouldn't expect it to be exported. |
Why @TylerHelmuth ? I thought this way I would be able to only consider exporting the logs that match this condition. Is there an exclusion by default or then this not the right approach to filter the way I would like to?
Should this filter include an "include" parameter or something ? I can not identify it here https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/filterprocessor/README.md |
|
You can do |
Thank you @TylerHelmuth this works for us ! |
Hello community,
I am trying to filter some logs based on the structure this log has. I am testing with a pod that outputs the following log every second :
I have tried the following filters but none of them are giving us any results:
First attempt :
Second attempt :
Third attempt :
Fourth attempt :
The filter is only working if we pick one of the attributes that are added from opentelemetry collector configuration :
As you can see in the image all the attributes or keys if we can refer to them as they come in the log json structure are mapped in the Splunk log entry, but when trying to use them in the filter we do not see any log error in the controller console. This seems to be a good syntax but I think maybe we are not pointing to the right way of getting the log content.
The text was updated successfully, but these errors were encountered: