# Xml filter array

**URL:** <https://discuss.elastic.co/t/xml-filter-array/96055>\
**Category:** Logstash\
**Created:** [August 7, 2017, 7:44am UTC](https://discuss.elastic.co/t/xml-filter-array/96055 "2017-08-07T07:44:55Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Lukas\_Tilch](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@Lukas\_Tilch](https://discuss.elastic.co/u/Lukas_Tilch)\
**Post date:** [August 8, 2017, 1:27pm UTC](https://discuss.elastic.co/t/xml-filter-array/96055/9 "2017-08-08T13:27:58Z")

</div>

I'm getting there step by step.

```
  ruby { code => "
  event.set('mksrevision', [event.get('ID'), event.get('author'), event.get('desc'), event.get('date')].transpose)
  array_of_hashes = event.get('mksrevision').collect { |i| {'id' => i[0], 'author' => i[1], 'desc' => i[2], 'date' => i[3]}}
  event.set('mks', array_of_hashes)
  "}

```

this creates an array "mks" wich basically has the richt structure

I need to parse each array elemnt as a seperate document to elasticsearch.

edit:  
got it after that i used

```
split {
         field => "mks"
     }

```

now its working, thanks magnus for bearing with me and my none existing ruby knowlege

---

_[View the full topic](https://discuss.elastic.co/t/xml-filter-array/96055)._
