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

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?

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

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.

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?

bump bump

Bumpity bump :slight_smile: Is this a bug in XML filter?