Im trying to drop logs in alloy, i know i can drop these in the application itself but i am trying to understand how to configure alloy
The input lines:
{
"level": 30,
"time": 1747211787180,
"pid": 1,
"hostname": "api-6b497f9b8d-bnxs7",
"reqId": "60ee8ca1-d9df-494b-be44-73fb63f46668",
"res": {
"statusCode": 204
},
"responseTime": 0.5024009943008423,
"msg": "request completed"
},
{
"level": 30,
"time": 1747211787179,
"pid": 1,
"hostname": "api-6b497f9b8d-bnxs7",
"reqId": "60ee8ca1-d9df-494b-be44-73fb63f46668",
"req": {
"method": "GET",
"url": "/api/public/healthcheck",
"host": "10.1.115.42:3001",
"remoteAddress": "10.1.103.111",
"remotePort": 14650
},
"msg": "incoming request"
}
I want to drop these completely and the stage.drop does nothing for me
this is the latest settings i am using
loki.process "process" {
forward_to = [loki.write.loki.receiver]
stage.drop {
older_than = "24h"
}
stage.json {
expressions = {
req = "req",
msg = "msg",
res = "res",
}
}
stage.json {
expressions = {
source = "req",
url = "url",
}
}
stage.json {
expressions = {
source = "res",
status = "statusCode",
}
}
stage.drop {
source = "url"
expression = "/api/public/healthcheck"
}
stage.drop {
source = "status"
expression = "204"
}
}
I have tried with url = “req.url” and that route also
What am i doing wrong here?