I have to parse some xml files (with xml filter) and store each child item (car) as a document in Elasticsearch but I don't see how I can do that.
My xml file could containt n child items (around 100-200 per xml file) and I need 1 record for each child. There is an example :
<cars> <car> <model>BMW</model> <color>Red</color> </car> <car> <model>Audi</model> <color>Yellow</color> </car> <car> <model>Mercedes</model> <color>Black</color> </car> </cars>
So I want to have 1 record for each car contained in my xml document. So the xpath param will be something like that
xpath => [ "/cars/car/model", "Model", "cars/car/color", "Color"]
But I don't get the logic of how can I tell Logstash to store each item in a new record =/
Could you explain me please?