revert hostname label
This commit is contained in:
@@ -31,6 +31,12 @@ loki.process "parse_hostname" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Fallback: Set hostname explicitly if not parsed
|
||||||
|
stage.static_labels {
|
||||||
|
values = {
|
||||||
|
hostname_fallback = system.hostname, // e.g., fm002
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refine labels
|
// Refine labels
|
||||||
@@ -50,11 +56,11 @@ loki.relabel "add_labels" {
|
|||||||
source_labels = ["hostname"]
|
source_labels = ["hostname"]
|
||||||
target_label = "hostname"
|
target_label = "hostname"
|
||||||
}
|
}
|
||||||
//rule {
|
rule {
|
||||||
// source_labels = ["hostname_fallback"]
|
source_labels = ["hostname_fallback"]
|
||||||
// target_label = "hostname"
|
target_label = "hostname"
|
||||||
// action = "replace"
|
action = "replace"
|
||||||
// replacement = "${__label:hostname_fallback}" // Only if hostname is unset
|
replacement = "${__label:hostname_fallback}" // Only if hostname is unset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user