add hostname label

This commit is contained in:
Arne Teuke
2025-03-11 14:49:30 +01:00
parent 77388a6d8c
commit 8ff5fbfa61

View File

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