# Issues parsing xml data

**URL:** <https://discuss.elastic.co/t/issues-parsing-xml-data/101760>\
**Category:** Logstash\
**Created:** [September 25, 2017, 9:18pm UTC](https://discuss.elastic.co/t/issues-parsing-xml-data/101760 "2017-09-25T21:18:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jspeer](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jspeer](https://discuss.elastic.co/u/jspeer)\
**Post date:** [September 25, 2017, 9:18pm UTC](https://discuss.elastic.co/t/issues-parsing-xml-data/101760/1 "2017-09-25T21:18:39Z")

</div>

I've setup a filter to try to split an XML and assign the fields to fields I can use but the split isn't working.

I'm using http\_poller to pull the following xml file over

```
<?xml version="1.0" encoding="UTF-8"?><df:Feed xmlns:df="http://www.domain.com/xsd/services/feed" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Concept="EX">
<df:Sku>
<df:Number>503616</df:Number>
<df:Name>Product 1 Name</df:Name>
<df:ImageUrl>https://www.domain.com/imgs/rk/images/dp/201724/0002/img31</df:ImageUrl>
</df:Sku>
<df:Sku>
<df:Number>244324</df:Number>
<df:Name>Product 2 Name</df:Name>
<df:ImageUrl>https://www.domain.com/imgs/rk/images/dp/201718/0013/img25</df:ImageUrl>
</df:Sku>
</df:Feed>

```

Here is the error that I'm receiving

```
#<REXML::UndefinedNamespaceException: Undefined prefix df found>

```

Here is the input/filter of my config

```
input {
  http_poller {
    urls => {
        url => "http://192.168.74.179:49180/data/14/P/66/10035/IVR.xml"
    }

    request_timeout => 10
    interval => 10

    codec => multiline {
      pattern => "^\<df\:Sku\>"
      negate => "true"
      what => "previous"
    }
  }
}

filter {
if [log_type] == "xmllog" {

xml {
    source => "message"
    target => "parsed"
    remove_namespaces => true
    store_xml => true
    force_array => true
    xpath => [
        "/Sku/Number/text()","number",
        "/Sku/Name/text()","name",
        "/Sku/ImageUrl/text()","url"
    ]
}

```

I've tried escaping the df: fields

```
field => "[parsed][df\:Sku]"

```

I'm able to separate the fields how I would like, however each filter request is throwing the undefined prefix error in the logs, throwing an xmlparsefailure.

---

<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:** [October 23, 2017, 9:19pm UTC](https://discuss.elastic.co/t/issues-parsing-xml-data/101760/2 "2017-10-23T21:19:22Z")

</div>

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