You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we removes body from the log field with filelog receiver and renames it then the converter renders the key value as Nil.
It's expected that if the value is Nil then key should not appear at all.
Steps to Reproduce
Use filelog receiver to read logs from a file with regex parser and rules as below- filelog/auditlog: include: - /var/log/audit/audit.log operators: - type: regex_parser regex: '^(?P<message>.*)$' - from: attributes.message to: attributes["message"] type: move - field: body type: remove
Body: Str(<nil>)
Attributes:
-> message: Str(kubelet: E0706 11:32:21.943440 4715 kubelet_volumes.go:245] "There were many similar errors. Turn up verbosity to see them." err="orphaned pod \"0d4cf341-424f-462c-a50a-406ac8f66331\" found, but error not a directory occurred when trying to remove the volumes dir" numErrs=5)
Additional context
No response
The text was updated successfully, but these errors were encountered:
That's actually in Sumo, this is effectively the body. The problem seems to be that if the body in the stanza Entry is nil, then the Body of the Otel LogRecord is a string with the value "<nil>", as opposed to the empty string or the empty value.
Component(s)
receiver/filelog
What happened?
Description
When we removes body from the log field with filelog receiver and renames it then the converter renders the key value as Nil.
It's expected that if the value is Nil then key should not appear at all.
Steps to Reproduce
Use filelog receiver to read logs from a file with regex parser and rules as below-
filelog/auditlog: include: - /var/log/audit/audit.log operators: - type: regex_parser regex: '^(?P<message>.*)$' - from: attributes.message to: attributes["message"] type: move - field: body type: remove
Expected Result
log
field should not appear in output.Actual Result
Getting Nil log field.
Collector version
v0.80.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: