From 58968ae0f1e68dd90f28194127ff9deef01834f0 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Tue, 11 Mar 2025 16:02:09 +0100 Subject: [PATCH] journal hostname label --- templates/config.alloy.erb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/templates/config.alloy.erb b/templates/config.alloy.erb index 056e101..af00b6f 100644 --- a/templates/config.alloy.erb +++ b/templates/config.alloy.erb @@ -10,14 +10,11 @@ loki.source.syslog "syslog" { // Process logs and extract hostname loki.process "extract_hostname" { - stage.logfmt { - mapping = { - "hostname" = "syslog_hostname" // Extracts the hostname from syslog - } - } + stage.logfmt {} + stage.labels { values = { - "hostname" = "hostname" // Assigns extracted hostname to the label + hostname = "syslog_hostname" } } forward_to = [loki.write.loki.receiver]