# Jdbc plugin : column with xml content

**URL:** <https://discuss.elastic.co/t/jdbc-plugin-column-with-xml-content/75906>\
**Category:** Logstash\
**Created:** [February 21, 2017, 3:42pm UTC](https://discuss.elastic.co/t/jdbc-plugin-column-with-xml-content/75906 "2017-02-21T15:42:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lemec\_Cinq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lemec_cinq/32/28949_2.png) [@Lemec\_Cinq](https://discuss.elastic.co/u/Lemec_Cinq)\
**Post date:** [February 21, 2017, 3:42pm UTC](https://discuss.elastic.co/t/jdbc-plugin-column-with-xml-content/75906/1 "2017-02-21T15:42:55Z")

</div>

I am importing a MS SQL table with an column that contains xml

those are values example:

```
<actor>
  <actor last_name="COSTNER" first_name="Kevin" />
  <actor last_name="DICAPRIO" first_name="Leonardo" />
</actor>
...
<actor>
  <actor last_name="PACINO" first_name="Al" />
  <actor last_name="GOSLINE" first_name="Bryan" />
  <actor last_name="MOYER" first_name="Stephen" />
</actor>

```

...

I would like to export that column to an elastic search field that would be in this object format:

```
 "actors": [
            {
              "first_name": "Kevin",
              "last_name": "COSTNER"
            },
            {
               "first_name": "Leonardo",
              "last_name": "DICAPRIO"
            }
          ]

```

Do you know if there is a way?

---

<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:** [February 22, 2017, 9:07am UTC](https://discuss.elastic.co/t/jdbc-plugin-column-with-xml-content/75906/2 "2017-02-22T09:07:44Z")

</div>

Have a look at the xml filter.

---

<div class="post-metadata">

**Author:** ![Lemec\_Cinq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lemec_cinq/32/28949_2.png) [@Lemec\_Cinq](https://discuss.elastic.co/u/Lemec_Cinq)\
**Post date:** [February 22, 2017, 10:59am UTC](https://discuss.elastic.co/t/jdbc-plugin-column-with-xml-content/75906/3 "2017-02-22T10:59:42Z")

</div>

```
xml {
	    source => "columnName"
	    xpath => ["//actor/@last_name", "last_name"]
	    xpath => ["//actor/@first_name", "first_name"]
		target => "fieldName"	   
   }
```

---

<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 22, 2017, 11:00am UTC](https://discuss.elastic.co/t/jdbc-plugin-column-with-xml-content/75906/4 "2017-03-22T11:00:08Z")

</div>

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