Grafana Loki: top 5 of syslog senders

Yes, it’s important to be mindful of the nature of the data you are trying to get.

In this case, you are trying to get an aggregated view of count over a period of time, so you don’t actually need a time series data. So you want to:

  1. Make sure in query option you set it to return 1 data point only.
  2. Change query type to instant instead of range.
  3. Make sure to use $__auto in your query interval.

And if you have a table dashboard, use transformation to hide timestamp, and set the colume that shows number to the type of gauge, then you’ll get a nice presentation like my screenshot above.

I had a discussion with someone else on a similar topic, I have a reply there with more details that may be of help to you: Cannot distinct data in Grafana Loki - #5 by elabkevin