1 year ago
#305348
DmitrySemenov
sort nginx logs with loki logql against request_time field
this is my logql query
{namespace="ingress-nginx"}
| json | http_host="admin.site.com" and request_time > 20 and status!="499"
| line_format "status={{.status}}\t request_time={{.request_time}}\t {{.request}}"
I get the following output
2022-03-17 11:47:58
status=200 request_time=21.346 GET /admin/membermanagement/routedelivery?after_save=1 HTTP/2.0
2022-03-17 11:47:54
status=200 request_time=26.639 GET /admin/membermanagement/routedelivery?after_save=1 HTTP/2.0
2022-03-17 11:47:45
status=200 request_time=26.036 GET /admin/membermanagement/routedelivery?after_save=1 HTTP/2.0
2022-03-17 11:47:43
status=200 request_time=25.548 GET /admin/membermanagement/routedelivery?after_save=1 HTTP/2.0
2022-03-17 03:22:29
status=200 request_time=22.950 GET /admin/locations/deliveryapproval HTTP/2.0
2022-03-17 03:22:28
status=200 request_time=22.685 GET /admin/locations/deliveryapproval HTTP/2.0
2022-03-16 18:53:05
status=200 request_time=20.875 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 16:28:32
status=200 request_time=24.673 GET /admin/report/dailyproduction HTTP/2.0
2022-03-16 16:28:16
status=200 request_time=25.315 GET /admin/report/dailyproduction HTTP/2.0
2022-03-16 16:27:04
status=200 request_time=21.222 GET /admin/payment HTTP/2.0
2022-03-16 16:22:09
status=200 request_time=55.375 GET /admin/membermanagement/routemanager HTTP/2.0
2022-03-16 16:21:57
status=200 request_time=25.150 GET /admin/report HTTP/2.0
2022-03-16 15:26:44
status=200 request_time=30.300 GET /admin/membermanagement/routedelivery?after_save=1 HTTP/2.0
2022-03-16 15:26:43
status=200 request_time=32.443 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:26:38
status=200 request_time=34.245 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:26:31
status=200 request_time=35.504 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:26:09
status=200 request_time=32.549 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:26:06
status=200 request_time=31.524 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:25:56
status=200 request_time=25.084 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:25:09
status=200 request_time=21.661 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:25:09
status=200 request_time=21.467 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:20:35
status=200 request_time=56.433 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:20:06
status=200 request_time=36.239 GET /admin/membermanagement/routedelivery?after_save=1 HTTP/2.0
2022-03-16 15:19:53
status=200 request_time=26.146 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 15:19:14
status=200 request_time=21.654 GET /admin/membermanagement/routedelivery?after_save=1 HTTP/2.0
2022-03-16 15:19:11
status=200 request_time=21.311 GET /admin/membermanagement/routedelivery HTTP/2.0
2022-03-16 14:32:03
status=200 request_time=20.591 GET /index.php HTTP/2.0
2022-03-16 14:27:17
status=200 request_time=20.837 GET /index.php HTTP/2.0
2022-03-16 14:20:15
status=200 request_time=21.976 POST /index.php HTTP/2.0
2022-03-16 14:20:14
status=200 request_time=21.630 POST /index.php HTTP/2.0
2022-03-16 14:20:14
status=200 request_time=20.733 POST /index.php HTTP/2.0
2022-03-16 14:19:57
status=200 request_time=20.458 POST /index.php HTTP/2.0
2022-03-16 14:17:39
status=200 request_time=22.275 POST / HTTP/2.0
is it possible to sort it by request_time?
grafana
grafana-loki
logql
0 Answers
Your Answer