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]