# Logstash xml filter ruby cleanup code help

**URL:** https://discuss.elastic.co/t/logstash-xml-filter-ruby-cleanup-code-help/279099
**Category:** Logstash
**Created:** [July 19, 2021, 5:48pm UTC](https://discuss.elastic.co/t/logstash-xml-filter-ruby-cleanup-code-help/279099 "2021-07-19T17:48:49Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [July 19, 2021, 10:50pm UTC](https://discuss.elastic.co/t/logstash-xml-filter-ruby-cleanup-code-help/279099/2 "2021-07-19T22:50:30Z")

</div>

Take a look at [this](https://discuss.elastic.co/t/how-to-exclude-xml-json-key-value-if-key-length-is-greater-than-15-char-and-value-length-is-greater-than-100-char/270248/8) which recursively descends into hashes and arrays in the parsed XML and deletes items that match a condition (in that case based on the length of the element name, but you can change that to be based on the value).

---

_[View the full topic](https://discuss.elastic.co/t/logstash-xml-filter-ruby-cleanup-code-help/279099)._
