# How to remove fields exist in \_source array field using logstash filter

**URL:** <https://discuss.elastic.co/t/how-to-remove-fields-exist-in-source-array-field-using-logstash-filter/303350>\
**Category:** Logstash\
**Created:** [April 27, 2022, 7:41am UTC](https://discuss.elastic.co/t/how-to-remove-fields-exist-in-source-array-field-using-logstash-filter/303350 "2022-04-27T07:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magesh\_02](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magesh_02/32/94023_2.png) [@Magesh\_02](https://discuss.elastic.co/u/Magesh_02)\
**Post date:** [April 27, 2022, 7:41am UTC](https://discuss.elastic.co/t/how-to-remove-fields-exist-in-source-array-field-using-logstash-filter/303350/1 "2022-04-27T07:41:30Z")

</div>

I'm trying to use a logstash filter to remove unwanted fields from the \_source field, but the data isn't being sent to ES.

```auto
filter {
    mutate {
        remove_field => ["path", "host","@version","@timestamp","type"]
    }
}

```

---

<div class="post-metadata">

**Author:** ![adrianfusco](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrianfusco/32/111798_2.png) [@adrianfusco](https://discuss.elastic.co/u/adrianfusco)\
**Post date:** [May 9, 2022, 8:39am UTC](https://discuss.elastic.co/t/how-to-remove-fields-exist-in-source-array-field-using-logstash-filter/303350/2 "2022-05-09T08:39:14Z")

</div>

Hello,

I think the problem isn't the `remove_field` directive in this case. It works at this way and it's correct.

Can you add more information about your `logstash` configuration? The `output` for example.

Are you receiving data from the `input`?

---

<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:** [June 6, 2022, 8:39am UTC](https://discuss.elastic.co/t/how-to-remove-fields-exist-in-source-array-field-using-logstash-filter/303350/3 "2022-06-06T08:39:27Z")

</div>

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