# Need help how to remove unwanted fields logstash

**URL:** <https://discuss.elastic.co/t/need-help-how-to-remove-unwanted-fields-logstash/302315>\
**Category:** Logstash\
**Created:** [April 13, 2022, 10:32am UTC](https://discuss.elastic.co/t/need-help-how-to-remove-unwanted-fields-logstash/302315 "2022-04-13T10:32:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![holpa](https://avatars.discourse-cdn.com/v4/letter/h/9de0a6/32.png) [@holpa](https://discuss.elastic.co/u/holpa)\
**Post date:** [April 13, 2022, 10:32am UTC](https://discuss.elastic.co/t/need-help-how-to-remove-unwanted-fields-logstash/302315/1 "2022-04-13T10:32:55Z")

</div>

Please tell me how to remove unnecessary fields. Type: agent.ephemeral\_id agent.id winlog.provider\_guid

I tried, But kibana stops showing logs at all

- drop\_fields: fields: ["date\_created", "ecs.version", "agent.version", "agent.type", "agent.id"]

I logstash have these configs: elk.conf:

```auto
input {
  beats {
    port => 5044
  }
}

filter {
    if "winsrvad" in [tags] {
    if [winlog][event_id] != "4776"{
	}
    }
}

output {
        elasticsearch {
            hosts => "localhost:9200"
            index => "winsrvad-%{+YYYY.MM.dd}"
            user => Logstash
            password => xxxxxxxx
    }
}

```

config winlogbeat:

```auto
winlogbeat.event_logs:
- name: ForwardedEvents
  forwarded: true

 # ignore_older: 72h

tags: ["winsrvad"]

output.logstash:
  hosts: ["10.10.0.1:5044"]

#logging.level: info
#logging.to_files: true
logging.files:
  path: C:\Program Files\winlogbeat

```

kibana or displays nothing or displays all event id

---

<div class="post-metadata">

**Author:** ![Cad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cad/32/86661_2.png) [@Cad](https://discuss.elastic.co/u/Cad)\
**Post date:** [April 13, 2022, 1:08pm UTC](https://discuss.elastic.co/t/need-help-how-to-remove-unwanted-fields-logstash/302315/2 "2022-04-13T13:08:40Z")

</div>

Hi,

To remove a field, you can use the [mutate filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-remove_field) in logstash.  
Use it like this:

```auto
filter {
  mutate {
    remove_field => ["date_created", "[ecs][version]", "[agent][version]", "[agent][type]", "[agent][id]" ]
  }
}

```

Cad.

---

<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:** [May 11, 2022, 1:08pm UTC](https://discuss.elastic.co/t/need-help-how-to-remove-unwanted-fields-logstash/302315/3 "2022-05-11T13:08:59Z")

</div>

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