Flux Group queries are named as columns. How to rename grouped data

Hello,
This is the query i run:

from(bucket: "PROD")
  |> range(start: -40m, stop: -30m)
  |> filter(fn: (r) => r["_measurement"] == "logging")
  |> filter(fn: (r) => r["_field"] == "type" or r["_field"] == "log" or r["_field"] == "ip")
  |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> group(columns: ["ip"], mode:"by")

The data in Grafana is grouped, however the group names are all the same: “_measurement, ip, log, type”.

I can not figure out how to rename these group names to show in the drop down as “X.X.X.X” like correct IP addresses.

Basically the questions are:

  • which variable does Grafana use to display group names
  • how to modify / rename the groups / the variable for Grafana to show correct groups.

Thank you.

Hi there,

I’m facing an issue of a similar nature. I don’t really care what the groups are called but the issue for me is that the group key is being included into every single column that I have and I want to get rid of that although I’m not sure how. Examples below: