Im a newbie to grafana i wrote a query with Loki query build like below
{ServerType=~"Unified Server", service=~"traefik", ServerId=~"MXQ2300BM1"} |~ "10.6.140" |~ "health"
which extracts the below log
{"ClientAddr"=>"10.6.140.110:46400", "ClientHost"=>"10.6.140.110",
"ClientPort"=>"46400", "ClientUsername"=>"-", "DownstreamContentSize"=>20,
"DownstreamStatus"=>200, "Duration"=>1623483, "OriginContentSize"=>20,
"OriginDuration"=>1545239, "OriginStatus"=>200, "Overhead"=>78244,
"RequestAddr"=>""shfhj, "RequestContentSize"=>0, "RequestCount"=>665228,
"RequestHost"=>"unifiedserver.acs", "RequestMethod"=>"GET",
"RequestPath"=>"/applications/nv-ad104-kappa-binning/health", "RequestPort"=>"-",
"RequestProtocol"=>"HTTP/1.1", "RequestScheme"=>"https", "RetryAttempts"=>0,
"RouterName"=>"nv-ad104-kappa-binning@docker", "ServiceAddr"=>"sdfd:8000", }
in this i want to parse the client addr in the first line as label to use in the agreegate operation in query builder i tried below code
{ServerType=~"Unified Server", service=~"traefik", ServerId=~"MXQ2300BM1"} |~ `10.6.140` |~ `health` | pattern `.*"ClientAddr"=>"(?<ClientAddr>[^"]+).*`
But its add the clientaddr as label so that i can use further also When a user clicks a particular IP, it should display the graph with what the Max count is for the two apps (demo, nv-ad104) based on user-selected time frame the app names are in the log before health in "RequestPath"=>"/applications/nv-ad104-kappa-binning/health"
how to parse all this and use in loki query .