Hello everyone!
I need some help!
I need to create a label using the values of two other labels.
In short, the task is to dynamically assign a tenant to log messages based on the values of other labels. One of the labels is set earlier via stage.static_labels
, and the second one is the standard namespace
.
I’ve tried different approaches, but maybe I’m doing something wrong.
loki.process "set_tenant" {
forward_to = [loki.write.loki_user.receiver]
stage.labels {
values = {
tenant = "{{$__labels__.cluster}}-{{$__labels__.__meta_kubernetes_namespace}}",
}
}
stage.tenant {
label = "tenant"
}
}