# Parse Array and Send to Elastic Filter

**URL:** https://discuss.elastic.co/t/parse-array-and-send-to-elastic-filter/306271
**Category:** Logstash
**Created:** [June 2, 2022, 8:39pm UTC](https://discuss.elastic.co/t/parse-array-and-send-to-elastic-filter/306271 "2022-06-02T20:39:26Z")
**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: [June 2, 2022, 9:00pm UTC](https://discuss.elastic.co/t/parse-array-and-send-to-elastic-filter/306271/2 "2022-06-02T21:00:52Z")

</div>

Perhaps use a [split](https://www.elastic.co/guide/en/logstash/current/plugins-filters-split.html) filter, so that instead of an event with an array you have three events in which [categories] is a string. It is really not clear what you want to do.

If there is a limit to the number of categories then you might also be able to do

```
if [categories][0] { elasticsearch { query => "someField: %{[categories][0]}" ... } }
if [categories][1] { elasticsearch { query => "someField: %{[categories][1]}" ... } }
if [categories][2] { elasticsearch { query => "someField: %{[categories][2]}" ... } }
if [categories][3] { elasticsearch { query => "someField: %{[categories][3]}" ... } }
```

---

_[View the full topic](https://discuss.elastic.co/t/parse-array-and-send-to-elastic-filter/306271)._
