Hi guys, would like to ask, currently I have configured alloy for EKS to scrape logs from application pods, however, I am facing issue when I tried to setup index labels, it became duplicate label.
My Loki.process are as below
loki.process "pod_logs" {
stage.static_labels {
values = {
cluster = "dev",
}
}
stage.json {
expressions = {
ts = "",
level = "",
traceID = "",
spanID = "",
path = "",
method = "",
status = "",
msg = "",
}
}
stage.labels {
values = {
traceID = "",
spanID = "",
level = "",
}
}
stage.timestamp {
source = "ts"
format = "Unix"
}
forward_to = [loki.process.remove_labels.receiver]
}
Logs sample output are as below:
{"level":"info","ts":"2025-05-29T11:26:10Z","msg":"Request processed successfully","status_code":200,"request_method":"GET","request_url":"/api/v1/healthz","protocol":"HTTP/1.1","user_agent":"kube-probe/1.32+","ip_address":"<redacted>","referer":"","content_type":"","content_length":"","traceID":"b2df9bd9ece531e34d23b2d993d91be6","spanID":"ccfa182d327cc0a4"}
Any help would be appreciated,
Thank you