Wrong Calculation for Grafana / Loki dashboard

hi, I have created dashboard to count percentage of 5xx errors from loki for application load balancer logs.
It looks like this:
sum(count_over_time({log_type="s3_lb"} | pattern <> <> <> <client_ip>:<> <> <> <> <> <elb_status_code> <> <> <> "<> <request_url> <>" “<user_agent>” <> <> <> “<>" "<>” “<>" <> <> "<>” “<>" "<>” “<>" "<>” “<>" "<>”| elb_status_code =~ "5.*" |__error__=""[$__interval])) / (sum(count_over_time({log_type="s3_lb"} | pattern<> <> <> <client_ip> <> <> <> <> <elb_status_code> <> <> <sent_bytes> "<> <request_url> <>" “<user_agent>” <> <> <> “<>" "<>” “<>" <> <> "<>” “<>" "<>” “<>" "<>” “<>" "<>” | __error__=""[$__interval])) / 100 )

But some reason the results is wrong


What can I check to resolve this issue?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.