Xml parser with xpath not giving result


(azze) #1

Hi,
I'm trying to parse xml files with the xpath plugin but it doesn't give me any result,

Here are my xml data and logstash conf.

<?xmlversion="1.0" encoding="utf-8"?>
<testResult>
   <executionLog>
      <numberOfTestCases>15</numberOfTestCases>
      <numberOfTestCasesPassed>9</numberOfTestCasesPassed>
      <numberOfTestCasesFailed>6</numberOfTestCasesFailed>
      <numberOfTestCasesNotExecuted>0</numberOfTestCasesNotExecuted>
    </executionLog>
</testResult>

input{
file{
path => "path"
start_position => "beginning"
exclude => "*.gz"
codec => multiline{
pattern => "<?xml version="1.0" encoding="utf-8"?>"
what => "next"
negate => true
max_lines => 5000000
}

}

}

filter{
xml{
remove_namespaces => "true"
source => "message"
xpath => ["testResult/executionLog/numberOfTestCases/text()","total"]
}
}

output {
elasticsearch {
hosts => ["localhost:9200"]
index => "toscatest"

}
stdout { codec => rubydebug }

}

Is something wrong with my conf ?

Thanks for helping :slight_smile:


#2

hope this helps you,


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.