journal hostname label
This commit is contained in:
@@ -10,11 +10,14 @@ loki.source.syslog "syslog" {
|
||||
|
||||
// Process logs and extract hostname
|
||||
loki.process "extract_hostname" {
|
||||
stage.logfmt {}
|
||||
|
||||
stage.logfmt {
|
||||
mapping = {
|
||||
"hostname" = "syslog_hostname", // Extracts the hostname from syslog
|
||||
}
|
||||
}
|
||||
stage.labels {
|
||||
values = {
|
||||
hostname = "syslog_hostname",
|
||||
"hostname" = "hostname", // Assigns extracted hostname to the label
|
||||
}
|
||||
}
|
||||
forward_to = [loki.write.loki.receiver]
|
||||
|
||||
Reference in New Issue
Block a user