Setting tag_key to a non-existing field causes a ruby error. #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps:
0) Configure fluent-plugin-remote-syslog.
where "bogus" is not a field of log messages.
Result: Following error/stacktraces are logged.
error_class="NoMethodError" error="undefined method
[]' for nil:NilClass" [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:106:in
send_to_syslog'[warn]: /etc/fluent/plugin/out_syslog_buffered.rb:85:in
block in write' [warn]: /usr/share/gems/gems/fluentd/lib/fluent/plugin/buf_memory.rb:67:in
feed_each'[warn]: /usr/share/gems/gems/fluentd/lib/fluent/plugin/buf_memory.rb:67:in
msgpack_each' [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:84:in
write'[warn]: /usr/share/gems/gems/fluentd/lib/fluent/buffer.rb:354:in
write_chunk' [warn]: /usr/share/gems/gems/fluentd/lib/fluent/buffer.rb:333:in
pop'[warn]: /usr/share/gems/gems/fluentd/lib/fluent/output.rb:342:in
try_flush' [warn]: /usr/share/gems/gems/fluentd/lib/fluent/output.rb:149:in
run'Fix: Prepare "rescue" for the case the tag_key value is not a log field,
i.e., record[@tag_key] is nil.