Xml processing using logstash 5.4

I have one xml file to process: e.g.

<?xml version="1.0" encoding="UTF-8"?>
<response>
<project>
<name>xxx<name>
<run>
<id>1</id>
<**firstView**>
<loadTime>6604</loadTime>
<videoFrames>
<frame>
<time>0</time>
<image>XXX</image>
<VisuallyComplete>0</VisuallyComplete>
</frame>
<frame>
<time>3137</time>
<image>XXX</image>
<VisuallyComplete>65</VisuallyComplete>
</frame>
<frame>
<time>3373</time>
<image>XXX</image>
<VisuallyComplete>63</VisuallyComplete>
</frame>
<frame>
**</firstView>**

I want parse<frame> array for <time>, <image> and <visual complete> and split each frame into new messages containing distinct values from each time, image and visual complete in respective field.

Any suggestion?
thanks.

I think there are a couple of options to explore:

  • Use an xml filter and its xpath option to extract the "frame" elements. Not sure exactly what further processing will be necessary. If you post the result it'll be easier to help.
  • Store the whole document (with the xml filter's store_xml option enabled) and postprocess the results.

Thanks, I will try these options.

About processing: want to dump time series data into DB for plotting line graph.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.