Hello,
I tried to format my xml in ES.
Xml Format :
<PlaceList xmlns="http://places.maps.here.com/pds">
<Place xmlns="http://places.maps.here.com/pds">
<Identity isDeleted="false" lastUpdatedTimeStamp="2018-09-02T21:45:09.677Z">
<PlaceId>250u03q7-235079d2a6cf494498fd36608f3cf81d</PlaceId>
<QualityLevel>5</QualityLevel>
</Identity>
</Place>
<Place xmlns="http://places.maps.here.com/pds">
<Identity isDeleted="false" lastUpdatedTimeStamp="2018-09-23T06:30:00.974Z">
<PlaceId>250spg6q-f9672d4b2c1f41209cd2f038d26a93ef</PlaceId>
<QualityLevel>4</QualityLevel>
</Identity>
</Place>
</PlaceList>
I tried with config :
input { {
file
{
codec => multiline
{
pattern => "<PlaceList>"
negate => "true"
what => "previous"
}
}}
filter {
xml {
source => "message"
store_xml => "false"
xpath => ["/PlaceList//Place", "places"]
}
split {
field => "places"
}
xml {
source => "places"
store_xml => "false"
xpath => ["/Place/Identity/PlaceId/text()", "place_id"]
remove_field => [ "places" ]
}
}
It's failed if i use the split : field:places is of type = NilClass.
If I comment the split and the last xml, I have no result,
The "message" field contains well the xml from beginning to the end.
Lucio