XML filter error


(Craig Foote) #1

Working with 2.1.0 logstash. With test.xml:
<node1>value1</node1>

...and configuration:

input{
    file{
        path => "/test.xml"
        start_position => "beginning"
        sincedb_path => "/dev/null"
    }
}
filter{
    xml{
        source => "message"
        store_xml => true
    }
}
output{
    stdout{ codec => rubydebug }
}

Gives _xmlparsefailure error message:

Trouble parsing xml with XmlSimple {:source=>"message", :value=>"<node1>value1</node1>", :exception=>#<NoMethodError: undefined method 'start_with?' for nil:NilClass>, :backtrace=>["logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.0-java/lib/logstash/filters/base.rb:151:in 'multi_filter'", etc.

Any help appreciated.


(Magnus Bäck) #2

As documented you need to set the target option if store_xml is true. Such a mistake should obviously result in a proper error message instead of a stacktrace—see github.com/logstash-plugins/logstash-filter-xml issue #9.


(Craig Foote) #3

Thanks Magnus.


(system) #4