Skip to content

Commit

Permalink
feat: parse basic logs with Promtail
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Feb 3, 2024
1 parent 72fe01c commit 27c9be7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions templates/server/promtail.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ scrape_configs:
journal:
labels:
job: journald
host: "{{ inventory_hostname }}"
host: {{ inventory_hostname }}
relabel_configs:
- source_labels: [__journal__systemd_unit]
target_label: systemd_unit
Expand All @@ -26,13 +26,19 @@ scrape_configs:
target_label: syslog_identifier
- source_labels: [__journal__comm]
target_label: command
pipeline_stages:
- json:
expressions:
level: level
- labels:
level:

- job_name: nginx
static_configs:
- targets:
- localhost
labels:
job: nginx
host: "{{ inventory_hostname }}"
host: {{ inventory_hostname }}
agent: promtail
__path__: /var/log/nginx/access.json.log

0 comments on commit 27c9be7

Please sign in to comment.