# Logstash - XML parsing including nested objects

**URL:** <https://discuss.elastic.co/t/logstash-xml-parsing-including-nested-objects/289323>\
**Category:** Logstash\
**Created:** [November 16, 2021, 12:42pm UTC](https://discuss.elastic.co/t/logstash-xml-parsing-including-nested-objects/289323 "2021-11-16T12:42:25Z")\
**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:** [November 16, 2021, 6:10pm UTC](https://discuss.elastic.co/t/logstash-xml-parsing-including-nested-objects/289323/2 "2021-11-16T18:10:46Z")

</div>

I would do that in ruby. [This](https://discuss.elastic.co/t/how-to-create-fields-from-nested-fields-for-json-data-in-logstash/239369/4) is an example of flattening objects. [This](https://discuss.elastic.co/t/how-to-extract-data-from-multiline-codec/287575/3) is an example of stripping a prefix from a field name.

You might want to use something like

```
newK = k.sub(/\.([^.]*$)/, "\1")
```

---

_[View the full topic](https://discuss.elastic.co/t/logstash-xml-parsing-including-nested-objects/289323)._
