-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[filelog] Can't remove syslog parts from log messages - collector crashes #40398
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
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
The To remove multiple fields, define multiple instances of the operator, like this: receivers:
filelog/my-app-1:
include_file_name: false
resource:
service.name: my-app-1
storage: file_storage/filelog
include:
- "/var/log/apps/my-app-1/standard.log"
operators:
- id: syslog-parser
type: syslog_parser
protocol: rfc5424
- id: remove-procid
type: remove
field: attributes.procid
- id: remove-msgid
type: remove
field: attributes.msgid
- id: remove-structured-data
type: remove
field: attributes.structured_data
retry_on_failure:
enabled: true The collector will log errors like the following when the field to be removed does not exist in a log: 2025-06-02T15:19:06.908+0200 error helper/transformer.go:118 Failed to process entry {"resource": {}, "otelcol.component.id": "filelog", "otelcol.component.kind": "receiver", "otelcol.signal": "logs", "operator_id": "remove-procid", "operator_type": "remove", "error": "remove: field does not exist: attributes.procid", "action": "send", "entry.timestamp": "0001-01-01T00:00:00.000Z"} To prevent this, set the operators' on_error property to Having said all this, the collector should not panic when misconfigured; it should rather fail to start. Let me know if this works for you @driprado. |
Thank you for your response @andrzej-stencel I have configured the operator as instructed:
And the collector started with no errors, however there were no changes to log output, and the msgid field has not been removed:
|
Component(s)
receiver/filelog
What happened?
Description
When using the remove operator after syslog_parser operator in filelog receiver, the collector panics with a nil pointer dereference. The goal is to remove specific syslog fields (PRI, VERSION, MSGID, STRUCTURED-DATA) from the output, but any attempt to use the remove operator results in a panic.
Steps to Reproduce
Expected Result
Actual Result
collector crashes with error:
Collector version
v0.113.0
Environment information
Environment
x86_64 x86_64 x86_64 GNU/Linux
OpenTelemetry Collector configuration
Log output
Additional context
The text was updated successfully, but these errors were encountered: