Skip to content
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

payloads with improperly-used reserved fields cause runtime errors #395

Open
yaauie opened this issue May 29, 2020 · 0 comments
Open

payloads with improperly-used reserved fields cause runtime errors #395

yaauie opened this issue May 29, 2020 · 0 comments

Comments

@yaauie
Copy link
Contributor

yaauie commented May 29, 2020

Consider the following filebeat.yml, which configures Filebeat to send payloads with the root-level @metadata field to be false.

filebeat.inputs:
  - type: log
    paths:
      - ...
    fields:
      "@metadata": false
    fields_under_root: true

This plugin decodes the given field from the payload and creates the event with @metadata set to false, but then throws a runtime exception when this plugin attempts to add key/value pairs to the @metadata:

org.jruby.exceptions.NoMethodError: (NoMethodError) undefined method `[]=' for false:FalseClass
	at [${LOGSTASH_HOME}].vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_beats_minus_6_dot_0_dot_9_minus_java.lib.logstash.inputs.beats.message_listener.onNewMessage(${LOGSTASH_HOME}/vendor/bundle/jruby/2.5.0/gems/logstash-input-beats-6.0.9-java/lib/logstash/inputs/beats/message_listener.rb:34) ~[?:?]

I believe we should guard against improper use of reserved fields, or at least log a warning. A separate issue around documenting reserved fields may be a useful reference: elastic/logstash#11946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant