# \[HELP\] Xml xpath dynamic destination-field

**URL:** <https://discuss.elastic.co/t/help-xml-xpath-dynamic-destination-field/220157>\
**Category:** Logstash\
**Created:** [February 20, 2020, 10:26am UTC](https://discuss.elastic.co/t/help-xml-xpath-dynamic-destination-field/220157 "2020-02-20T10:26:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FajarFebriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fajarfebriano/32/63011_2.png) [@FajarFebriano](https://discuss.elastic.co/u/FajarFebriano)\
**Post date:** [February 20, 2020, 10:26am UTC](https://discuss.elastic.co/t/help-xml-xpath-dynamic-destination-field/220157/1 "2020-02-20T10:26:22Z")

</div>

Based on documentation [Logstash Xpath](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html)

My XML Format :

```
<isomsg direction="outgoing">
	<!-- org.jpos.iso.packager.GenericPackager[cfg/packager/iso87binaryedc.xml] -->
	<field id="0" value="0210"/>
	<field id="3" value="120002"/>
	<field id="4" value="000000165000"/>
	<field id="11" value="000001"/>
	<field id="32" value="1144"/>
</isomsg>

```

My Logstash configuration :

```
xml{
    source => "message"
    xpath => 
      [
        "/isomsg/@direction", "direction",
        "/isomsg/field/@value", " **/isomsg/field/@id**"
      ]
    store_xml => true
    target => "data"
  } 

```

i want to be id = value, how to be done like that ?

---

<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:** [March 19, 2020, 10:26am UTC](https://discuss.elastic.co/t/help-xml-xpath-dynamic-destination-field/220157/2 "2020-03-19T10:26:23Z")

</div>

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