I don’t think I fully understand Loki’s documentation. Please help me with the following task.
Unfortunately, unwrap
expression does’t work with the count_over_time
function.
The task is simple:
I want to draw a graph from the access.log file on the lines containing the “GET” message, by status codes, and the “Y” axis shows the number of status codes every 10 minutes (the number of status codes in that unit of time).
The log’s browser:
count_over_time(
{filename="/var/log/nginx/access.log"} |~ "\"GET\\s"
| pattern `<remote_addr> - - [<time_local>] "<request>" <status> <body_bytes_sent> "<http_referer>" "<http_user_agent>" "<http_x_forwarded_for>"`
| unwrap status [10m]) by (status)
#### parse error : grouping not allowed for count_over_time aggregation
What is the solution?
Thank you!