fluent / fluentd

Fluentd: Unified Logging Layer (project under CNCF)
https://www.fluentd.org
Apache License 2.0
12.9k stars 1.34k forks source link

emit warning along with unmatched line #3501

Open schen2315 opened 3 years ago

schen2315 commented 3 years ago

Is your feature request related to a problem? Please describe.

Hello, we use emit_unmatched so user knows which ip/host sent the failed syslog message. Can the warning message (failed to parse/ invalid syslog/ etc) be added to the emit_unmateched message as well?

Describe the solution you'd like

Add the logged warning message to emit_unmatched

Describe alternatives you've considered

None

Additional context

No response

ashie commented 3 years ago

Do you mean emit_unmatched_lines of in_syslog and want to add a reason of unmatched to the emitted record?

ashie commented 3 years ago

As you said, it doesn't add reasons to emitted records, and they seem worth to add.

https://github.com/fluent/fluentd/blob/3e146a89146979bc80872e2433075b19050a1ac6/lib/fluent/plugin/in_syslog.rb#L229-L234

https://github.com/fluent/fluentd/blob/3e146a89146979bc80872e2433075b19050a1ac6/lib/fluent/plugin/in_syslog.rb#L241-L246

https://github.com/fluent/fluentd/blob/3e146a89146979bc80872e2433075b19050a1ac6/lib/fluent/plugin/in_syslog.rb#L262-L266