I am trying to load a basic xml file into logstash but somehow, the file is not loaded. No exceptions are thrown and I am running Logstash through command prompt and not as a service. Could you please check and help me figure out what I am doing wrong.
Below is my xml file :
<LogEntry>
<Terminal>SYSTEM</Terminal>
<EvTxt_1>6940</EvTxt_1>
<EvTxt_2>0</EvTxt_2>
<EvTxt_3>0</EvTxt_3>
<EvTxt_4>0</EvTxt_4>
<EvTxt_5>0</EvTxt_5>
</LogEntry>
And, my config file looks like this :
input {
file {
path => "C:\xml_test\test4.xml"
start_position => "beginning"
sincedb_path => "null"
codec => multiline
{
pattern => "^<\?LogEntry .*\>"
negate => false
what => "next"
}
}
}
filter {
xml {
store_xml => false
source => "message"
target => "xml_content"
xpath => ["/LogEntry/Terminal/text()","terminal"]
}
}
output {
stdout { codec => json_lines }
elasticsearch {
"hosts" => ["http://localhost:9200"]
"index" => "xml_test"
"document_type" => "data"
}
}