Promtail - Auto Discovery Logs

Good day to all. We’ve installed our Grafana/Loki and Promtail, so far everything’s running good. We have nginx web server with multiple websites (to add more in the future), is there a way to have our promtail auto-discover the access/error logs of our websites separately? (i.e website1/access.log, website2/access.log). Thanks!

Hi @orayt03, thanks for the question.

You could use globbing patterns to locate all the logs, for example:

scrape_configs:
  - job_name: sites
    static_configs:
      - targets:
          - localhost
        labels:
          job: app
          __path__: /var/www/**/*.log
2 Likes