hi everyone, can someone help me with this example? I have an XML file, I originally wanted to change it to JSON and use logstash to send it to elasticsearch, many times it didn't work so I decided to keep the XML and use XML filter but it also failed, I tried already tried many ways but only return "message" which is a very long XML or JSON string. here is my XML file
<?xml version="1.0" encoding="UTF-8"?>
<List name="log-buffer"
xmlns="http://bacnet.org/csml/1.2">
<Sequence name="778000">
<DateTime name="timestamp" value="2014-06-03T20:12:36.80"/>
<Choice name="logDatum">
<Real name="real-value" value="23.2418"/>
</Choice>
<BitString name="statusFlags" value=""/>
</Sequence>
<Sequence name="778001">
<DateTime name="timestamp" value="2014-06-03T20:13:36.99"/>
<Choice name="logDatum">
<Real name="real-value" value="23.1019"/>
</Choice>
<BitString name="statusFlags" value=""/>
</Sequence>
<Sequence name="778099">
<DateTime name="timestamp" value="2014-06-03T21:52:05.88"/>
<Choice name="logDatum">
<Real name="real-value" value="25.4676"/>
</Choice>
<BitString name="statusFlags" value=""/>
</Sequence>
<Sequence name="778100">
<DateTime name="timestamp" value="2014-06-03T21:53:06.08"/>
<Choice name="logDatum">
<Real name="real-value" value="25.4554"/>
</Choice>
<BitString name="statusFlags" value=""/>
</Sequence>
</List>
and file json after convert
{
"List": {
"@name": "log-buffer",
"@xmlns": "http://bacnet.org/csml/1.2",
"Sequence": [
{
"@name": "778000",
"DateTime": {
"@name": "timestamp",
"@value": "2014-06-03T20:12:36.80"
},
"Choice": {
"@name": "logDatum",
"Real": {
"@name": "real-value",
"@value": "23.2418"
}
},
"BitString": {
"@name": "statusFlags",
"@value": ""
}
},
{
"@name": "778001",
"DateTime": {
"@name": "timestamp",
"@value": "2014-06-03T20:13:36.99"
},
"Choice": {
"@name": "logDatum",
"Real": {
"@name": "real-value",
"@value": "23.1019"
}
},
"BitString": {
"@name": "statusFlags",
"@value": ""
}
},
{
"@name": "778099",
"DateTime": {
"@name": "timestamp",
"@value": "2014-06-03T21:52:05.88"
},
"Choice": {
"@name": "logDatum",
"Real": {
"@name": "real-value",
"@value": "25.4676"
}
},
"BitString": {
"@name": "statusFlags",
"@value": ""
}
},
{
"@name": "778100",
"DateTime": {
"@name": "timestamp",
"@value": "2014-06-03T21:53:06.08"
},
"Choice": {
"@name": "logDatum",
"Real": {
"@name": "real-value",
"@value": "25.4554"
}
},
"BitString": {
"@name": "statusFlags",
"@value": ""
}
}
]
}
}
Can someone help me? I'm a newbie