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

xml filter: "target" setting required #3843

Closed
jacobweber opened this issue Sep 2, 2015 · 2 comments
Closed

xml filter: "target" setting required #3843

jacobweber opened this issue Sep 2, 2015 · 2 comments

Comments

@jacobweber
Copy link

https://www.elastic.co/guide/en/logstash/master/plugins-filters-xml.html#plugins-filters-xml-target

The "target" setting should be listed as required, and probably validated. If I omit it, I get an error:

Trouble parsing xml with XmlSimple {:source=>"message", :value=>"<foo>bar</foo>", :exception=>#<NoMethodError: undefined method `start_with?' for nil:NilClass>, :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/event.rb:140:in `[]='", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-xml-1.0.0/lib/logstash/filters/xml.rb:129:in `filter'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/filters/base.rb:163:in `multi_filter'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/filters/base.rb:160:in `multi_filter'", "(eval):382:in `cond_func_7'", "org/jruby/RubyArray.java:1613:in `each'", "(eval):371:in `cond_func_7'", "(eval):234:in `filter_func'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:219:in `filterworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:157:in `start_filters'"], :level=>:warn}

My filter is:

xml {
    source => message
}

and my XML is:

<foo>bar</foo>

Using LogStash 1.5.4.

@magnusbaeck
Copy link
Contributor

I suggest we close this issue as it duplicates logstash-plugins/logstash-filter-xml#8 (document that the option is required) and logstash-plugins/logstash-filter-xml#9 (fix the filter so it doesn't crash when the option isn't set).

@suyograo
Copy link
Contributor

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

No branches or pull requests

3 participants