# Logstash remove field

**URL:** <https://discuss.elastic.co/t/logstash-remove-field/297209>\
**Category:** Logstash\
**Created:** [February 15, 2022, 5:33am UTC](https://discuss.elastic.co/t/logstash-remove-field/297209 "2022-02-15T05:33:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandima\_jayamina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandima_jayamina/32/99168_2.png) [@chandima\_jayamina](https://discuss.elastic.co/u/chandima_jayamina)\
**Post date:** [February 15, 2022, 5:33am UTC](https://discuss.elastic.co/t/logstash-remove-field/297209/1 "2022-02-15T05:33:57Z")

</div>

Hi I am new to ELK. I am thinking what is the best way to remove field.

1. Just use mutate filter and remove field
2. First set field to nil and then use mutate filter and remove

What is the best way to remove the field. And I want to free the space on my heap quickly.

---

<div class="post-metadata">

**Author:** ![sholzhauer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sholzhauer/32/110282_2.png) [@sholzhauer](https://discuss.elastic.co/u/sholzhauer)\
**Post date:** [February 15, 2022, 10:51am UTC](https://discuss.elastic.co/t/logstash-remove-field/297209/2 "2022-02-15T10:51:53Z")

</div>

Just use mutate remove\_field. As this will remove it before ingest it.

---

<div class="post-metadata">

**Author:** ![chandima\_jayamina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandima_jayamina/32/99168_2.png) [@chandima\_jayamina](https://discuss.elastic.co/u/chandima_jayamina)\
**Post date:** [February 15, 2022, 12:50pm UTC](https://discuss.elastic.co/t/logstash-remove-field/297209/3 "2022-02-15T12:50:32Z")

</div>

I want to know how it helps for garbage collector to save space on heap

---

<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:** [February 15, 2022, 4:54pm UTC](https://discuss.elastic.co/t/logstash-remove-field/297209/4 "2022-02-15T16:54:10Z")

</div>

> [@chandima\_jayamina](#):
>
> I want to know how it helps for garbage collector to save space on heap

Can you explain, in detail, why you care about that? What do your current GC stats look like? What does the logstash pipeline configuration look like?

---

<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:** [March 15, 2022, 4:54pm UTC](https://discuss.elastic.co/t/logstash-remove-field/297209/5 "2022-03-15T16:54:43Z")

</div>

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