# Parsing xml with name value pairs?

**URL:** <https://discuss.elastic.co/t/parsing-xml-with-name-value-pairs/79506>\
**Category:** Logstash\
**Created:** [March 21, 2017, 9:23pm UTC](https://discuss.elastic.co/t/parsing-xml-with-name-value-pairs/79506 "2017-03-21T21:23:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darren114](https://avatars.discourse-cdn.com/v4/letter/d/ea666f/32.png) [@darren114](https://discuss.elastic.co/u/darren114)\
**Post date:** [March 21, 2017, 9:23pm UTC](https://discuss.elastic.co/t/parsing-xml-with-name-value-pairs/79506/1 "2017-03-21T21:23:54Z")

</div>

Can someone please provide an example config file setup to parse a xml file with name value pairs? I have a sample xml input below:

```
<MOBILE_COMMUNICATION LastSyncTs="2016-09-06T22:54:55.631Z" Type="Incremental_Sync_vod">
 <MOBILE_TRANSACTIONS id="98968721-BD53-4126-A3A7-F5F3B6A2C3BE" type="CRASHLOG">
  <MOBILE_TRANSACTION action="U" id="NONE">
  <OBJECT name="LOG">
    <FIELD name="ORGID" value="data"/>
    <FIELD name="USERNAME" value="data"/>
    <FIELD name="USERID" value="data"/>
    <FIELD name="IREPVERSION" value="27.0.4"/>
    <FIELD name="MEMORYUSAGE" value="N/A"/>
    <FIELD name="IPADVERSION" value="iPad4,1"/>
    <FIELD name="IOSVERSION" value="7.1.2"/>
    <FIELD name="BREADCRUMBS" value=""/>
    <FIELD name="CRASHTIMESTAMP" value="2016-09-07 06:28:29 +0000"/>
    <FIELD name="CRASHHASH" value="f26d551d97106f4d5d0eb306b042a4f0"/>
    <FIELD name="CRASHLOG" value="data"/>
   </OBJECT>
  </MOBILE_TRANSACTION>
 </MOBILE_TRANSACTIONS>
</MOBILE_COMMUNICATION>

```

Particularly, I need to retrieve all name and value pairs inside FIELD.

---

<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:** [March 22, 2017, 6:36am UTC](https://discuss.elastic.co/t/parsing-xml-with-name-value-pairs/79506/2 "2017-03-22T06:36:17Z")

</div>

Have you tried using the xml filter? It won't give you exactly what you want out of the box but it'll be a good starting point.

---

<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:** [April 19, 2017, 6:36am UTC](https://discuss.elastic.co/t/parsing-xml-with-name-value-pairs/79506/3 "2017-04-19T06:36:28Z")

</div>

Closed on April 19, 2017, 6:36am UTC

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