add hostname label

This commit is contained in:
Arne Teuke
2025-03-11 14:52:15 +01:00
parent 8ff5fbfa61
commit 1deeb1eb72

View File

@@ -20,15 +20,15 @@ loki.source.file "system_logs" {
loki.relabel "add_labels" {
forward_to = [loki.write.loki.receiver]
rule {
action = "replace"
source_label = "__host__"
target_label = "hostname"
rule {
action = "replace"
source_labels = ["__host__"]
target_label = "hostname"
}
rule {
action = "replace"
source_label = "${env.HOSTNAME}"
target_label = "hostname"
rule {
action = "replace"
source_labels = "${env.HOSTNAME}"
target_label = "hostname"
}
rule {
action = "replace"