diff options
author | Martin Fischer <martin@push-f.com> | 2025-03-23 21:17:38 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-03-26 08:50:12 +0100 |
commit | 59fa8a9cdc8f7f5cb2bf6d9c42d9f1b6b8197bbb (patch) | |
tree | 3e8fe5f2ee9539692bc88d5814b81f52c9e24fde /nixos/hosts/tente/monitoring.nix | |
parent | dbc3621c794806b2a8badad292b909610108fc74 (diff) |
tweak(tente): use logfmt for osm-proposals
Diffstat (limited to 'nixos/hosts/tente/monitoring.nix')
-rw-r--r-- | nixos/hosts/tente/monitoring.nix | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/nixos/hosts/tente/monitoring.nix b/nixos/hosts/tente/monitoring.nix index b9c806e..7e92eed 100644 --- a/nixos/hosts/tente/monitoring.nix +++ b/nixos/hosts/tente/monitoring.nix @@ -169,13 +169,32 @@ in loki.source.journal "journal" { max_age = "12h0m0s" relabel_rules = discovery.relabel.journal.rules - forward_to = [loki.write.default.receiver] + forward_to = [loki.process.journal.receiver] labels = { host = "tente", job = "systemd-journal", } } + loki.process "journal" { + forward_to = [loki.write.default.receiver] + + stage.match { + // Select messages from systemd services that have LogExtraFields=log_format=logfmt. + selector = "{__journal_log_format=\"logfmt\"}" + stage.logfmt { + mapping = { time = "", level = "" } + } + stage.timestamp { + source = "time" + format = "RFC3339" + } + stage.structured_metadata { + values = { level = "" } + } + } + } + discovery.relabel "journal" { targets = [] |