# Filebeats not dropping agent.\* fields

**URL:** <https://discuss.elastic.co/t/filebeats-not-dropping-agent-fields/204907>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 23, 2019, 3:58pm UTC](https://discuss.elastic.co/t/filebeats-not-dropping-agent-fields/204907 "2019-10-23T15:58:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronin](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@Ronin](https://discuss.elastic.co/u/Ronin)\
**Post date:** [October 23, 2019, 3:58pm UTC](https://discuss.elastic.co/t/filebeats-not-dropping-agent-fields/204907/1 "2019-10-23T15:58:03Z")

</div>

We are using filebeats 7.4.0 in a k8s cluster to ship logs to ES, however when specifying a processor to drop the agent.\* fields they are still sent to ES. Config is as follows:

```auto
    filebeat.inputs:
    - type: docker
      containers.ids:
      - '*'
      processors:
      - add_docker_metadata:
      - add_kubernetes_metadata:
          in_cluster: true
      - rename:
          fields:
          - from: "log_level"
            to: "level"
          - from: "log_tag"
            to: "tag"
          ignore_missing: true
      - drop_fields:
          fields: ["agent.ephemeral_id", "agent.hostname", "agent.id", "agent.type", "agent.version", "host.name", "ecs.version", "input.type"]
          ignore_missing: true
    output.elasticsearch:
      hosts: ["https://es-host:443"]
      protocol: "https"
      compression: 3

```

---

<div class="post-metadata">

**Author:** ![kumarabhi](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kumarabhi](https://discuss.elastic.co/u/kumarabhi)\
**Post date:** [October 23, 2019, 5:05pm UTC](https://discuss.elastic.co/t/filebeats-not-dropping-agent-fields/204907/2 "2019-10-23T17:05:39Z")

</div>

There is a global Processors section. Please use that. I tired it and it works  
#================================Processors=====================================

```
#Configure processors to enhance or manipulate events generated by the beat.

processors:
  - drop_fields:
       fields: ["agent.ephemeral_id", "agent.hostname", "agent.id", "agent.type", "agent.version", "host.name", "ecs.version", "input.type"]
```

---

<div class="post-metadata">

**Author:** ![Ronin](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@Ronin](https://discuss.elastic.co/u/Ronin)\
**Post date:** [October 23, 2019, 7:51pm UTC](https://discuss.elastic.co/t/filebeats-not-dropping-agent-fields/204907/3 "2019-10-23T19:51:47Z")

</div>

@kumarabhi thanks that worked!

---

<div class="post-metadata">

**Author:** ![kumarabhi](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kumarabhi](https://discuss.elastic.co/u/kumarabhi)\
**Post date:** [October 23, 2019, 8:47pm UTC](https://discuss.elastic.co/t/filebeats-not-dropping-agent-fields/204907/4 "2019-10-23T20:47:24Z")

</div>

Welcome. Please accept the answer as solution and close the topic.

---

<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:** [November 20, 2019, 8:47pm UTC](https://discuss.elastic.co/t/filebeats-not-dropping-agent-fields/204907/5 "2019-11-20T20:47:29Z")

</div>

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