Table – Group by + Count?

  • What Grafana version and what operating system are you using?
    Debian 11, Grafana 9.2.5
  • What are you trying to achieve?
    I want to groupby distinct count in the table. For each country code, I’d like to group by and show the number of instances (count).

I am looking for a table that has 2 columns: Country, Count

  • How are you trying to achieve it?
    I’ve tried using Group By in transformations panel. But no “count” appears in the table. If I try to use “Calculate > Count”, nothing happens.

  • Can you copy/paste the configuration(s) that you are having problems with?
    My query is very simple {job="http-access"} | json

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No errors.

  • Did you follow any online instructions? If so, what is the URL?
    I followed everything I could search on SO + this forum.

I also tried doing this natively in the query itself:

But, now the table appears to group by country, but it is not a “flat” table. It has a drop down selection menu like this:

The query is as follows:

count by(country) (rate({job="http-access"} | json [$__interval]))

I just want a very simple two column table with country and number of times it appears in the selected interval. Any help appreciated, spent way too much time on this, I feel like this is a simple thing to do and I am definitely missing core understanding of how Grafana works.