Skip to content

Commit

Permalink
promtail test
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Jan 11, 2025
1 parent b3605b5 commit 4d90886
Showing 1 changed file with 37 additions and 14 deletions.
51 changes: 37 additions & 14 deletions loki/promtail-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,40 @@ scrape_configs:
# labels:
# job: varlogs
# __path__: /var/log/host/*log
- job_name: smarthome
static_configs:
- targets:
- localhost
labels:
job: smarthome
__path__: /var/log/share/*.log
- job_name: zigbee
static_configs:
- targets:
- localhost
labels:
job: zigbee
__path__: /var/log/zigbee/**/*.log
- job_name: smarthome
static_configs:
- targets:
- localhost
labels:
job: smarthome
__path__: /var/log/share/*.log

- job_name: zigbee
static_configs:
- targets:
- localhost
labels:
job: zigbee
__path__: /var/log/zigbee/**/*.log

- job_name: astro
journal:
max_age: 12h
relabel_configs:
# Keep only log lines whose systemd unit is astro.service
- source_labels: ['__journal__systemd_unit']
regex: astro\.service
action: keep

# Rename Promtail’s internal label __journal__systemd_unit to a simpler "unit"
- source_labels: ['__journal__systemd_unit']
target_label: 'unit'

- source_labels: []
target_label: 'host'
replacement: 'silent'

# 4) Add an extra label 'app'
- source_labels: []
target_label: 'app'
replacement: 'astro'

0 comments on commit 4d90886

Please sign in to comment.