journal hostname label

This commit is contained in:
Arne Teuke
2025-03-11 16:02:09 +01:00
parent 654989ce7c
commit 58968ae0f1

View File

@@ -10,14 +10,11 @@ loki.source.syslog "syslog" {
// Process logs and extract hostname // Process logs and extract hostname
loki.process "extract_hostname" { loki.process "extract_hostname" {
stage.logfmt { stage.logfmt {}
mapping = {
"hostname" = "syslog_hostname" // Extracts the hostname from syslog
}
}
stage.labels { stage.labels {
values = { values = {
"hostname" = "hostname" // Assigns extracted hostname to the label hostname = "syslog_hostname"
} }
} }
forward_to = [loki.write.loki.receiver] forward_to = [loki.write.loki.receiver]