# Any sane way to filter/remove fields in an array such as \[0\], \[1\]?

**URL:** <https://discuss.elastic.co/t/any-sane-way-to-filter-remove-fields-in-an-array-such-as-0-1/278140>\
**Category:** Logstash\
**Created:** [July 8, 2021, 6:21am UTC](https://discuss.elastic.co/t/any-sane-way-to-filter-remove-fields-in-an-array-such-as-0-1/278140 "2021-07-08T06:21:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)\
**Post date:** [July 8, 2021, 6:21am UTC](https://discuss.elastic.co/t/any-sane-way-to-filter-remove-fields-in-an-array-such-as-0-1/278140/1 "2021-07-08T06:21:44Z")

</div>

Hi,

My data contains an array from which I only want to save the message fields. But I don't think you can do regexp on fields in prune, grok or mutate filters (I tried, it didn't work). The problem is that I do not know how many items there will be in the array so I need something like `if [myfield][0-9]+[subfields] -> do something`.

I know there is the ruby plugin but I don't know ruby.

---

<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:** [August 5, 2021, 6:22am UTC](https://discuss.elastic.co/t/any-sane-way-to-filter-remove-fields-in-an-array-such-as-0-1/278140/2 "2021-08-05T06:22:13Z")

</div>

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