# Beats and Docker autodiscover - only works with container start/stop

**URL:** <https://discuss.elastic.co/t/beats-and-docker-autodiscover-only-works-with-container-start-stop/137853>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 28, 2018, 7:20pm UTC](https://discuss.elastic.co/t/beats-and-docker-autodiscover-only-works-with-container-start-stop/137853 "2018-06-28T19:20:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgreszcz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sgreszcz/32/46322_2.png) [@sgreszcz](https://discuss.elastic.co/u/sgreszcz)\
**Post date:** [June 28, 2018, 7:20pm UTC](https://discuss.elastic.co/t/beats-and-docker-autodiscover-only-works-with-container-start-stop/137853/1 "2018-06-28T19:20:27Z")

</div>

Quick question about the filebeat and metricbeat "autodiscover" feature for Docker. Does this work with "static" containers, or does metric/log collection from within the docker container only begin if the beats notice a "start" trigger via the Docker API.

The reason I'm asking is that I have some static containers (such as elasticsearch itself in Docker) that only start if the Ubuntu server is started/rebooted. I'm not sure if the "autodiscover" feature will find containers that are already started when the beats container is started.

I guess a work-around would be to start the filebeat and metricbeat container before the reset of the application containers...

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [June 28, 2018, 7:46pm UTC](https://discuss.elastic.co/t/beats-and-docker-autodiscover-only-works-with-container-start-stop/137853/2 "2018-06-28T19:46:55Z")

</div>

Yes, this will work. It lists the running containers when it starts up. Then after that it uses the docker events stream to observe the starts and stops.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [June 28, 2018, 8:47pm UTC](https://discuss.elastic.co/t/beats-and-docker-autodiscover-only-works-with-container-start-stop/137853/3 "2018-06-28T20:47:28Z")

</div>

Documentation update: [https://github.com/elastic/beats/pull/7468](https://github.com/elastic/beats/pull/7468)

---

<div class="post-metadata">

**Author:** ![sgreszcz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sgreszcz/32/46322_2.png) [@sgreszcz](https://discuss.elastic.co/u/sgreszcz)\
**Post date:** [June 29, 2018, 8:14am UTC](https://discuss.elastic.co/t/beats-and-docker-autodiscover-only-works-with-container-start-stop/137853/4 "2018-06-29T08:14:22Z")

</div>

Hey thanks so much for this clarification. I'm going to experiment with autodiscover on filebeats/metricbeats today to simplify the docker monitoring.

---

<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:** [July 27, 2018, 8:14am UTC](https://discuss.elastic.co/t/beats-and-docker-autodiscover-only-works-with-container-start-stop/137853/5 "2018-07-27T08:14:23Z")

</div>

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