# Filebeat failed to collect docker metadata

**URL:** https://discuss.elastic.co/t/filebeat-failed-to-collect-docker-metadata/270321
**Category:** Beats
**Tags:** filebeat
**Created:** [April 16, 2021, 3:20am UTC](https://discuss.elastic.co/t/filebeat-failed-to-collect-docker-metadata/270321 "2021-04-16T03:20:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ktpktr0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ktpktr0/32/87157_2.png) [@ktpktr0](https://discuss.elastic.co/u/ktpktr0)
#### Post date: [April 16, 2021, 3:20am UTC](https://discuss.elastic.co/t/filebeat-failed-to-collect-docker-metadata/270321/1 "2021-04-16T03:20:05Z")

</div>

I use filebeat to collect docker container logs. The log is collected by ID, but the corresponding container name cannot be collected. So I tried to add metadata for the docker container, but I couldn't succeed（Auto discovery can also collect docker logs, but it can't use multiple configurations like input）

The current configuration is as follows:

```auto
filebeat.config.inputs:
  enabled: true
  path: /root/filebeat/*.yml
  reload.enabled: true
  reload.period: 60s
  processors:
  - add_docker_metadata:
    host: "unix:///var/run/docker.sock"
    #match_source: true

output.logstash:
  hosts: ["192.168.1.251:5044"]
max_procs: 1
queue.mem:
  events: 256
  flush.min_events: 128
  flush.timeout: 5s

logging.level: info
logging.to_files: true
logging.files:
  path: /var/log/filebeat
  name: filebeat.log
  keepfiles: 3
  permissions: 0644

```

Specific business log：

```auto
- type: docker
  containers.ids:
    - '2e2b4073b0c751732634682a03ecd6e1433fe1f2c7703ce1235ff3b6a071147e'
    - '27cdc8fdecfd58c0f8bcd2971964bcea72f6f2dd600443972bde55b34e24fb1b'
    - '341c6baf93754cf8c6083a159f1bf0b690c9512f2d0c125a65e709ab59693bea'
  tags: ["mysql_console_pre"]
  fields:
    service: mysql_console
  fields_under_root: true
  tail_files: false

```

I can collect docker logs, but I can't get the corresponding metadata。

---

<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 14, 2021, 5:20am UTC](https://discuss.elastic.co/t/filebeat-failed-to-collect-docker-metadata/270321/2 "2021-05-14T05:20:28Z")

</div>

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