Promtail is the log sending client for Grafana Loki. For traditional Linux systems, an RPM package is available from upstream, making installation fairly simple. Configuration is stored in a YAML file, so again, it's straightforward to configure via Ansible variables. Really, the only interesting step is adding the _promtail_ user, which is created by the RPM package, to the _systemd-journal_ group, so that Promtail can read the systemd journal files.
30 lines
771 B
YAML
30 lines
771 B
YAML
promtail_default_scrape:
|
|
journal:
|
|
job_name: journal
|
|
journal:
|
|
json: false
|
|
labels:
|
|
job: systemd-journal
|
|
relabel_configs:
|
|
- source_labels:
|
|
- __journal__hostname
|
|
target_label: hostname
|
|
- source_labels:
|
|
- __journal__systemd_unit
|
|
target_label: unit
|
|
- source_labels:
|
|
- __journal_syslog_identifier
|
|
target_label: syslog_identifier
|
|
- source_labels:
|
|
- __journal_priority
|
|
target_label: priority
|
|
- source_labels:
|
|
- __journal_message_id
|
|
target_label: message_id
|
|
- source_labels:
|
|
- __journal__comm
|
|
target_label: command
|
|
- source_labels:
|
|
- __journal__transport
|
|
target_label: transport
|