# Drop irrelevant filebeat docker metadata not working

**URL:** <https://discuss.elastic.co/t/drop-irrelevant-filebeat-docker-metadata-not-working/315887>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [October 5, 2022, 2:23pm UTC](https://discuss.elastic.co/t/drop-irrelevant-filebeat-docker-metadata-not-working/315887 "2022-10-05T14:23:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chma](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@Chma](https://discuss.elastic.co/u/Chma)\
**Post date:** [October 5, 2022, 2:23pm UTC](https://discuss.elastic.co/t/drop-irrelevant-filebeat-docker-metadata-not-working/315887/1 "2022-10-05T14:23:23Z")

</div>

I am using filebeat to ship container logs to ELK. I have way too many metadata that I don't need.  
`container.id, container.name, conatiner.labels, container.image` and so on. The only one I need her is `container.name`, so I am trying to drop the rest.

This is my configuration file, but what had worked for dropping the host meta isn't working for dropping the docker metadata. Am I missing something?

```auto
filebeat.inputs:
- type: filestream
  id: my-filestream-id
  enabled: true
  paths:
    - /home/logs/**/*.log
- type: container
  enable: true
  paths: 
    - "/var/lib/docker/containers/*/*.log"
filebeat.config.modules:
  path: /etc/filebeat/modules.d/*.yml
  reload.enabled: false
filebeat.autodiscover:
  providers:
    - type: docker
      hints.enabled: true
processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: 
      host: "unix:///var/run/docker.sock"
  - drop_fields:
      fields: ["container.id", "container.labels", "container.image"]
  - decode_json_fields:
      fields: ["message"]
      target: "json"
      overwrite_keys: true
  - drop_fields:
        fields: ["agent", "cloud", "ecs", "host", "input", "tags"
        ignore_missing: true
output.logstash:
  hosts: ["${elasticip}:5044"]

```

---

<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 2, 2022, 4:23pm UTC](https://discuss.elastic.co/t/drop-irrelevant-filebeat-docker-metadata-not-working/315887/2 "2022-11-02T16:23:56Z")

</div>

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