# How to include specified docker containers in Filebeat?

**URL:** <https://discuss.elastic.co/t/how-to-include-specified-docker-containers-in-filebeat/197753>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [September 3, 2019, 4:41am UTC](https://discuss.elastic.co/t/how-to-include-specified-docker-containers-in-filebeat/197753 "2019-09-03T04:41:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhaozhiming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zhaozhiming/32/53465_2.png) [@zhaozhiming](https://discuss.elastic.co/u/zhaozhiming)\
**Post date:** [September 3, 2019, 4:41am UTC](https://discuss.elastic.co/t/how-to-include-specified-docker-containers-in-filebeat/197753/1 "2019-09-03T04:41:56Z")

</div>

Hi All, I have a problem struggle some days and I find many Filebeat documents but I can't find the correct answer.

I want to make Filebeat only fetch the logs of the specified docker containers. I try the **processor** and **autodiscover** but both not work.

**The processor type filebeat.yml :**

```auto
filebeat.config:
  modules:
     path: ${path.config}/modules.d/*.yml
     reload.enabled: false
 
filebeat.autodiscover:
  providers:
    - type: docker
      hints.enabled: true
 
processors:
  - drop_event:
     when:
       or:
         - equals:
             docker.container.name: "foo"
         - equals:
             docker.container.name: "bar"

```

**The autodiscover type filebeat.yml:**

```auto
filebeat.config:
  modules:
    path: ${path.config}/modules.d/*.yml
    reload.enabled: false
 
filebeat.autodiscover:
  providers:
    - type: docker
      hints.enabled: true
      templates:
        - condition:
          equals:
              docker.container.name: "foo"
        - condition:
          equals:
              docker.container.name: "bar"
 
processors:
  - add_cloud_metadata: ~

```

Please help me to find a way to get the specified docker container logs. Thanks.

---

<div class="post-metadata">

**Author:** ![zhaozhiming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zhaozhiming/32/53465_2.png) [@zhaozhiming](https://discuss.elastic.co/u/zhaozhiming)\
**Post date:** [September 4, 2019, 1:37am UTC](https://discuss.elastic.co/t/how-to-include-specified-docker-containers-in-filebeat/197753/2 "2019-09-04T01:37:45Z")

</div>

Anyone help?

---

<div class="post-metadata">

**Author:** ![zhaozhiming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zhaozhiming/32/53465_2.png) [@zhaozhiming](https://discuss.elastic.co/u/zhaozhiming)\
**Post date:** [September 5, 2019, 1:46am UTC](https://discuss.elastic.co/t/how-to-include-specified-docker-containers-in-filebeat/197753/3 "2019-09-05T01:46:59Z")

</div>

Anybody?

---

<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:** [October 3, 2019, 1:47am UTC](https://discuss.elastic.co/t/how-to-include-specified-docker-containers-in-filebeat/197753/4 "2019-10-03T01:47:03Z")

</div>

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