# Docker filebeat autodiscover not detecting nginx logs

**URL:** <https://discuss.elastic.co/t/docker-filebeat-autodiscover-not-detecting-nginx-logs/239849>\
**Category:** Beats\
**Created:** [July 3, 2020, 7:04pm UTC](https://discuss.elastic.co/t/docker-filebeat-autodiscover-not-detecting-nginx-logs/239849 "2020-07-03T19:04:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [July 6, 2020, 6:05pm UTC](https://discuss.elastic.co/t/docker-filebeat-autodiscover-not-detecting-nginx-logs/239849/2 "2020-07-06T18:05:16Z")

</div>

Hi @Fachtna_Simi. welcome to the Elastic community forums!

Based on the documentation at [https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html), [https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover.html#\_docker\_2](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover.html#_docker_2), and [https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-docker.html](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-docker.html) the following configuration should work.

Keep your `Dockerfile` as-is.

Change your `filebeat.yml` to this:

```auto
filebeat.autodiscover:
  providers:
    - type: docker
      templates:
        - condition:
            contains:
              docker.container.image: nginx
          config:
            - module: nginx
              access:
                enabled: true
                input:
                  type: container
                  paths:
                    - /var/lib/docker/containers/${data.docker.container.id}/*.log
                  stream: stdout
              error:
                enabled: true
                input:
                  type: container
                  paths:
                    - /var/lib/docker/containers/${data.docker.container.id}/*.log
                  stream: stderr

output.console:
  pretty: true

```

And start up Filebeat like so:

```auto
sudo docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/containers/:/var/lib/docker/containers:ro filebeat

```

Hope that helps,

Shaunak

---

_[View the full topic](https://discuss.elastic.co/t/docker-filebeat-autodiscover-not-detecting-nginx-logs/239849)._
