summaryrefslogtreecommitdiffstats
path: root/ansible_collections/grafana/grafana/examples/promtail-multiple-logs.yml
blob: d49f542ada34785ae2985cbf74883e811ef843fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
- name: Deploy Promtail to ship logs to the local Loki instance
  hosts: all
  become: true
  roles:
    - role: grafana.grafana.promtail
  vars:
    promtail_clients:
      - url: http://localhost:3100/loki/api/v1/push
    promtail_scrape_configs:
      - job_name: system
        static_configs:
          - targets:
              - localhost
            labels:
              job: messages
              instance: "{{ ansible_fqdn }}"
              __path__: /var/log/messages
          - targets:
              - localhost
            labels:
              job: nginx
              instance: "{{ ansible_fqdn }}"
              __path__: /var/log/nginx/*.log