Hello All, I'm trying to get my head around the XML Filter, I have the following configuration for my filter.
xml {
source => "message"
target => "message_parsed"
add_tag => ["xml_parsed"]
When I parse the following extract through logstash.
20150525T20:21:13 <stats><stats xmlns='jcs:stats:jsm'><current-online-user-count>1730</current-online-user-count><login-rate>0</login-rate><successful_logins>93645</successful_logins><failed_logins>84583</failed_logins><uptime>1900999</uptime></stats>
<statsxmlns='jcs:stats:delivery'><total-message-packets>5428196</total-message-packets><total-presence-packets>288328380</total-presence-packets><total-iq-packets>4977074</total-iq-packets><messages-in-last-time-slice>0</messages-in-last-time-slice><average-message-size>0</average-message-size></stats></stats>
I seem to end up with what looks like an ARRAY.. What I was hoping for was a JSON type document, where each specific element within the XML, is defined with it's own field. What I actually see on my console is the following - objects in an array, are not well supported in Kibana..
"message_parsed" => {
"stats" => [
[0] {
"xmlns" => "jcs:stats:jsm",
"current-online-user-count" => [
[0] "10"
],
"login-rate" => [
[0] "0"
],
"successful_logins" => [
[0] "100"
],
"failed_logins" => [
[0] "5"
],
"uptime" => [
[0] "1901060"
]
},
[1] {
"xmlns" => "jcs:stats:delivery",
"total-message-packets" => [
[0] "1000"
],
"total-presence-packets" => [
[0] "100000"
],
"total-iq-packets" => [
[0] "100000"
],
"messages-in-last-time-slice" => [
[0] "0"
],
"average-message-size" => [
[0] "0"
]
}
I was expecting to see in my JSON document, something like
"user-count" : "value"
"login-rate" : "value"
Any ideas on how I can fix this, or am I misunderstanding what the XML filter should be doing here. Examples would be helpful..
Thanks.
Boardman