Hi I am trying to add labels to my logs and it just doesn’t seem to work. I tried going through the documents multiple times but I think I am missing something basic. Here is my config.alloy:
livedebugging {
enabled = true
}
local.file_match “BORDevelopmentLog” {
path_targets = [{“path” = “C:/logs/Observability/Logs/Development/BOR/*.json”}]
sync_period = “5s”
}
loki.source.file “BORDevelopmentLog_scrape” {
targets = local.file_match.BORDevelopmentLog.targets
forward_to = [loki.process.filter_log_level.receiver]
tail_from_end = true
}
loki.process “filter_log_level” {
stage.labels {
values = {
application = “BOR”,
}
}
forward_to = [loki.write.grafana_loki.receiver]
}
loki.write “grafana_loki” {
endpoint {
url = “http://localhost:3100/loki/api/v1/push”
}
wal{
enabled = true
}
}
I am running the live debugger and it just doesn’t seem to want to add the new application label
Listening for incoming data…
[IN]: timestamp: 2025-05-14T11:40:54.6189023-04:00, entry: {“Timestamp”:“2025-05-14T11:40:54.3848426-04:00”,“Level”:“Information”,“MessageTemplate”:“I am an info log with dictionary”,“TraceId”:“dcbbb5e5bc90216c3e0aa889b1e3711c”,“SpanId”:“050f38b49eab7d92”,“Properties”:{“prop1”:“value1”,“MachineName”:“B1Z0X93”,“ProcessId”:21716,“ThreadId”:55}} , labels: {filename=“C:\logs\Observability\Logs\Development\BOR\Log-20250514.json”}, structured_metadata: {}
[OUT]: timestamp: 2025-05-14T11:40:54.6189023-04:00, entry: {“Timestamp”:“2025-05-14T11:40:54.3848426-04:00”,“Level”:“Information”,“MessageTemplate”:“I am an info log with dictionary”,“TraceId”:“dcbbb5e5bc90216c3e0aa889b1e3711c”,“SpanId”:“050f38b49eab7d92”,“Properties”:{“prop1”:“value1”,“MachineName”:“B1Z0X93”,“ProcessId”:21716,“ThreadId”:55}} , labels: {filename=“C:\logs\Observability\Logs\Development\BOR\Log-20250514.json”}, structured_metadata: {}