Create an "top 10 clients" query from caddy access log

Hi.

I would like to create some web statistics from access logs, in this case caddys one.

I would like to create an table which shows the most client IP from $PERIODE

This query show a graph with numbers but not like a table

sum by (host) (
  rate({ kubernetes_pod_name=~"^craft-caddy.*" } != "debug" !="/admin/"
  | json
  | line_format "{{.message}}"
  | json
  | line_format "{{.request_client_ip}}" [1m]
  )
  )

My expectation or target is like

IP 1: 2000

IP 2: 400

IP X: 50

What’s the right way to create such a web statistic?

Maybe something similar like https://awstats.sourceforge.io/ ?