# Help Logstash XML Parsing to Xpath

**URL:** https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051
**Category:** Logstash
**Created:** [July 14, 2020, 4:17am UTC](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051 "2020-07-14T04:17:24Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [July 14, 2020, 5:27pm UTC](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051/2 "2020-07-14T17:27:13Z")

</div>

You would use an xml filter. Either store the whole XML

```
xml { source => "message" target => "theXML" force_array => false }

```

or pull parts of it out using xpath

```
    xml {
        source => "message"
        store_xml => false
        xpath => {
            "/NewData/Data/@ID" => "ID"
            "/NewData/Data/ClientConfig/ClientSetting/text()" => "Setting"
        }
    }

```

would get you

```
   "Setting" => [
    [0] "true",
    [1] "true",
    [2] "true",
    [3] "true",
    [4] "true"
],
        "ID" => [
    [0] "1234"
]
```

---

_[View the full topic](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051)._
