# Issue with removing tag

**URL:** <https://discuss.elastic.co/t/issue-with-removing-tag/327193>\
**Category:** Logstash\
**Created:** [March 7, 2023, 2:33pm UTC](https://discuss.elastic.co/t/issue-with-removing-tag/327193 "2023-03-07T14:33:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harika](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@Harika](https://discuss.elastic.co/u/Harika)\
**Post date:** [March 7, 2023, 2:33pm UTC](https://discuss.elastic.co/t/issue-with-removing-tag/327193/1 "2023-03-07T14:33:21Z")

</div>

we are having the `<system-out><![CDATA[]]></system-out>` tag in our XML File. Due to this tag it could not index and throwing the below Error:

`"error"=>{"type"=>"illegal_argument_exception", "reason"=>"can't merge a non object mapping [theXML.testsuite.testcase.system-out] with an object mapping"}}}}`

so,tried the below snippet for removing the mentioned tag but not able to remove the tag.

logStash snippet:

```auto
ruby {
code =>"
hash = event.to_hash
hash.each do |k,v|
if v == '{}'
event.remove(k)
end
end
"
}

```

Can you please suggest on this?

---

<div class="post-metadata">

**Author:** ![Harika](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@Harika](https://discuss.elastic.co/u/Harika)\
**Post date:** [March 9, 2023, 1:27pm UTC](https://discuss.elastic.co/t/issue-with-removing-tag/327193/2 "2023-03-09T13:27:03Z")

</div>

Actually the issue is system-out field has 2 types of values - it may have value or maybe empty.  
Can you suggest a solution how can it be processed without error or if there is a may to delete the field at all places.

---

<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:** [April 6, 2023, 1:27pm UTC](https://discuss.elastic.co/t/issue-with-removing-tag/327193/3 "2023-04-06T13:27:33Z")

</div>

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