# How to indexing to elastic specific tag of xml?

**URL:** <https://discuss.elastic.co/t/how-to-indexing-to-elastic-specific-tag-of-xml/175976>\
**Category:** Logstash\
**Created:** [April 9, 2019, 8:04am UTC](https://discuss.elastic.co/t/how-to-indexing-to-elastic-specific-tag-of-xml/175976 "2019-04-09T08:04:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandar.raj](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mandar.raj](https://discuss.elastic.co/u/mandar.raj)\
**Post date:** [April 9, 2019, 8:04am UTC](https://discuss.elastic.co/t/how-to-indexing-to-elastic-specific-tag-of-xml/175976/1 "2019-04-09T08:04:18Z")

</div>

How to indexing to elastic specific tag of xml?  
I want to index specific tag only from below xml format could you please help me?

\<records\<record\<details\<furtherinformation

---

<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:** [April 9, 2019, 11:17am UTC](https://discuss.elastic.co/t/how-to-indexing-to-elastic-specific-tag-of-xml/175976/2 "2019-04-09T11:17:58Z")

</div>

If you have an event that looks like

```
<records><record><details><furtherinformation>Foo</furtherinformation></details></record></records>

```

You can use an [xml](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html) filter to parse it. For example

```
    xml {
        source => "message"
        store_xml => false
        xpath => { "/records/record/details/furtherinformation/text()" => "FurtherInformation" }
        remove_field => ["message"]
    }

```

will get you

```
"FurtherInformation" => [
    [0] "Foo"
]
```

---

<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:** [May 7, 2019, 11:18am UTC](https://discuss.elastic.co/t/how-to-indexing-to-elastic-specific-tag-of-xml/175976/3 "2019-05-07T11:18:05Z")

</div>

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