# Xml processing using logstash 5.4

**URL:** <https://discuss.elastic.co/t/xml-processing-using-logstash-5-4/90261>\
**Category:** Logstash\
**Created:** [June 21, 2017, 10:12am UTC](https://discuss.elastic.co/t/xml-processing-using-logstash-5-4/90261 "2017-06-21T10:12:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saket\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Saket\_Kumar](https://discuss.elastic.co/u/Saket_Kumar)\
**Post date:** [June 21, 2017, 10:12am UTC](https://discuss.elastic.co/t/xml-processing-using-logstash-5-4/90261/1 "2017-06-21T10:12:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 21, 2017, 11:19am UTC](https://discuss.elastic.co/t/xml-processing-using-logstash-5-4/90261/2 "2017-06-21T11:19:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Saket\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Saket\_Kumar](https://discuss.elastic.co/u/Saket_Kumar)\
**Post date:** [June 21, 2017, 12:19pm UTC](https://discuss.elastic.co/t/xml-processing-using-logstash-5-4/90261/3 "2017-06-21T12:19:24Z")

</div>

Thanks, I will try these options.

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 19, 2017, 12:19pm UTC](https://discuss.elastic.co/t/xml-processing-using-logstash-5-4/90261/4 "2017-07-19T12:19:52Z")

</div>

Closed on July 19, 2017, 12:19pm UTC

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