I am parsing Traefik logs into Loki and I have a log entry like:
{
"Request": "{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/test\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/2.0\",\"ProtoMajor\":2,\"ProtoMinor\":0,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"something\"],\"X-Forwarded-Host\":[\"example.com\"],\"X-Forwarded-Port\":[\"443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"xxx\"],\"X-Real-Ip\":[\"x.x.x.x\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"example.com\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"x.x.x.x:yyy\",\"RequestURI\":\"/test\",\"TLS\":null}",
"level": "debug",
"msg": "vulcand/oxy/roundrobin/rr: begin ServeHttp on request",
"time": "2021-12-13T11:52:42-05:00"
}
Grafana can detect the objects like level, msg, and request but is there a way to convert that Request line to json and have it detect or expand that as well? The result should be something like request.method, reqest.URL, etc.