# Can't merge a non object mapping with an object mapping

**URL:** <https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374>\
**Category:** Logstash\
**Created:** [December 16, 2015, 4:07pm UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374 "2015-12-16T16:07:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![CraigFoote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craigfoote/32/4571_2.png) [@CraigFoote](https://discuss.elastic.co/u/CraigFoote)\
**Post date:** [December 16, 2015, 4:08pm UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374/1 "2015-12-16T16:08:00Z")

</div>

I'm ingesting an XML document and getting the following error:

> Merging dynamic updates triggered a conflict: Can't merge a non object mapping [doc.a.b] with an object mapping [doc.a.b]

XML:

```
<a>
    <b/>
    <b>c</b>
</a>

```

What's the problem here? It's valid XML isn't it?

---

<div class="post-metadata">

**Author:** ![wiibaa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wiibaa/32/44931_2.png) [@wiibaa](https://discuss.elastic.co/u/wiibaa)\
**Post date:** [December 18, 2015, 12:19pm UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374/2 "2015-12-18T12:19:40Z")

</div>

Can you please give some more details,

Are you using the xml filter ?  
Sample event output with stdout { code =\> rubydebug } that is failing for Elasticsearch ?  
What version of Elasticsearch ?  
What version of Logstash ?

Thanks

---

<div class="post-metadata">

**Author:** ![CraigFoote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craigfoote/32/4571_2.png) [@CraigFoote](https://discuss.elastic.co/u/CraigFoote)\
**Post date:** [December 18, 2015, 3:32pm UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374/3 "2015-12-18T15:32:47Z")

</div>

Thanks for responding!

I am using the xml filter:  
xml{  
source =\> "message"  
target =\> doc  
store\_xml =\> true  
}

I am using version 2.1.0 of both Logstash and Elasticsearch.

I can't copy and paste the rubydebug output because I'm running on a non-internet-connected machine but I do see this:

> "doc" =\> {  
> "b" =\> [  
> [0] {}  
> [1] "c"  
> ]  
> }

So it seems the problem is only when indexing into elasticsearch (I get zero docs ingested). I know array elements have to be the same type so I guess in this case it doesn't see the value of b[0] as being a String so that when b[1] comes along it creates a String and it's incompatible somehow?

Is there anything I can do in the XML to work around this? I tried changing the self-closing `<b/>` to `<b></b>` with no change. I hesitate to add a space value.

---

<div class="post-metadata">

**Author:** ![CraigFoote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craigfoote/32/4571_2.png) [@CraigFoote](https://discuss.elastic.co/u/CraigFoote)\
**Post date:** [December 22, 2015, 5:17pm UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374/4 "2015-12-22T17:17:31Z")

</div>

I converted the XML to JSON and used the JSON filter and it just works, showing the empty nodes as empty values. Is this a bug in the XML filter?

---

<div class="post-metadata">

**Author:** ![CraigFoote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craigfoote/32/4571_2.png) [@CraigFoote](https://discuss.elastic.co/u/CraigFoote)\
**Post date:** [January 4, 2016, 1:54pm UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374/5 "2016-01-04T13:54:32Z")

</div>

bump bump

---

<div class="post-metadata">

**Author:** ![CraigFoote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craigfoote/32/4571_2.png) [@CraigFoote](https://discuss.elastic.co/u/CraigFoote)\
**Post date:** [January 15, 2016, 8:23pm UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374/6 "2016-01-15T20:23:26Z")

</div>

Bumpity bump 🙂 Is this a bug in XML filter?

---

<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:** [July 6, 2017, 5:15am UTC](https://discuss.elastic.co/t/cant-merge-a-non-object-mapping-with-an-object-mapping/37374/7 "2017-07-06T05:15:34Z")

</div>


