I have the following logstash conf file:
input {
file {
path => "C:/logstash/data/test.xml"
start_position => beginning
codec => multiline
{
pattern => "^<\?providerConfigResponse .*\>"
negate => true
what => "previous"
}
}
filter {
xml {
store_xml => false
source => "message"
xpath =>
[
"/providerConfigResponse//svgconfig", "svConfig",
"/providerConfigResponse//svgconfig//function","function"
]
}
}
output {
elasticsearch {
index => "xmltest"
document_type => "xmlfiles"
hosts => "localhost:9200"
}
stdout { codec => json }
and my file xml :
<providerConfigResponse>
<svgconfig>
<name>SVG1</name>
<function>
test 1
</function>
<function>
test 2
</function>
</svgconfig>
<svgconfig>
<name>SVG2</name>
<function>
test 3
</function>
</svgconfig>
<svgconfig>
<name>SVG3</name>
<function>
test 4
</function>
<function>
test 5
</function>
</svgconfig>
</providerConfigResponse>
and i want to have ouput json liks this :
{
"svgconfig" : [function: test 1, function: test 2],
"svgconfig" : test 3,
" svgconfig" : [function: test 4, function: test 5]
}
But with my config i don't have what i want
I use logstash v5.4.0 and elasticsearch v5.4.0
Any solution ?
thanks

