journal hostname label
This commit is contained in:
@@ -20,7 +20,7 @@ loki.process "extract_hostname" {
|
|||||||
"hostname" = "hostname", // Assigns extracted hostname to the label
|
"hostname" = "hostname", // Assigns extracted hostname to the label
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forward_to = [loki.write.loki.receiver]
|
forward_to = [loki.relabel.add_labels.receiver]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -42,13 +42,18 @@ loki.source.file "system_logs" {
|
|||||||
|
|
||||||
// Relabel logs to add hostname and job labels
|
// Relabel logs to add hostname and job labels
|
||||||
loki.relabel "add_labels" {
|
loki.relabel "add_labels" {
|
||||||
forward_to = [loki.write.loki.receiver]
|
|
||||||
|
|
||||||
|
rule {
|
||||||
|
action = "replace"
|
||||||
|
target_label = "host"
|
||||||
|
replacement = "hostname"
|
||||||
|
}
|
||||||
rule {
|
rule {
|
||||||
action = "replace"
|
action = "replace"
|
||||||
target_label = "job"
|
target_label = "job"
|
||||||
replacement = "syslogs"
|
replacement = "syslogs"
|
||||||
}
|
}
|
||||||
|
forward_to = [loki.write.loki.receiver]
|
||||||
}
|
}
|
||||||
|
|
||||||
loki.write "loki" {
|
loki.write "loki" {
|
||||||
|
|||||||
Reference in New Issue
Block a user