Dockerized Filebeat & NGINX Logs

Does anyone know how to use filebeat.autodiscover with the nginx module?

I have filebeat.autodiscover working with nginx, e.g.

filebeat.autodiscover:
  providers:
    - type: docker
      templates:
        - condition:
            contains.docker.container.image: "nginx"
          config:
            - type: docker
              containers.ids:
                - "${data.docker.container.id}"

But if I really want to use the nginx module... e.g.

filebeat.autodiscover:
  providers:
    - type: docker
      templates:
        - condition:
            contains.docker.container.image: "nginx"
          config:
            - module: nginx
              access:
                input:
                  type: docker
                  containers.ids:
                    - "${data.docker.container.id}"

Should I be able to do this?

Yes, this should work, but this input entry should be prospector instead. You can see the documentation about filebeat autodiscover here: https://www.elastic.co/guide/en/beats/filebeat/6.2/configuration-autodiscover.html

Thanks so much !

1 Like

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