admin管理员组

文章数量:1131394

This is my loki log format look like:

2025-01-07 15:15:35.612 
{"request_time":"2025-01-07T07:15:35+00:00","refer_domain":"/","uri":"/youxuetest/miniapp/youzihui-shop-testout/1.0.1/assets/uni-forms.c9f6234a.js","return_code":200,"domain":"www.danet","route_id":"508853602857518009","body_bytes_sent":"16210"}
2025-01-07 15:15:35.609 
{"refer_domain":"/","return_code":200,"request_time":"2025-01-07T07:15:35+00:00","body_bytes_sent":"7378","domain":"www.danet","route_id":"508853602857518009","uri":"/youxuetest/miniapp/youzihui-shop-testout/1.0.1/assets/uni-easyinput.361c23c0.js"}

now I want to sum the fields body_bytes_sent by time range, then I write my query command like this:

?query=sum_over_time({app="minio-traffic"} | json | unwrap body_bytes_sent [1m])

this is the query url:

http://192.168.116.89:3100/loki/api/v1/query_range?query=sum_over_time({app=%22minio-traffic%22}%20|%20json%20|%20unwrap%20body_bytes_sent%20[1m])

what I expect the result is only one row that tell me the last 1m's body_bytes_sent size, what I found the rsult is that there contains many rows and some tiems exeed the limit of 500. I have tried using sum function but it not work. Am I missing something? what should I do to make the aggregation query work?

本文标签: loki sum over time return too many resultStack Overflow