Setup filebeat custom nginx access logs path inside docker container

How to configure a filebeat running inside a docker container to get access logs from nginx running in another container?
Nginx access logs are not in default location so the paths must be configured.

I've tried using the following config without results:

filebeat.autodiscover:
  providers:
    - type: docker
      hints.enabled: true
      templates:
        - condition:
            contains:
              docker.container.image: swag
          config:
            - module: nginx
              access:
                enabled: true
                var.paths: [ "/config/log/nginx/access.log*" ]
              error:
                enabled: true
                var.paths: [ "/config/log/nginx/error.log*" ]

Is the /config/log/nginx/ folder available in the container that's running Filebeat?

Shaunak

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