Hi - very new to Grafana and Influxdb and flux language
Simple query
from(bucket: "sensors")
|> range(start: -20m)
|> filter(fn: (r) =>
r._measurement == "Switches" and
r._field == "switch_state"
)
|> last()
returns:
switch_state {host="somehost", switch_id="s10", switch_name="SomeSwitchName"}
switch_state (host="somehost", switch_id="s11", switch_name="OtherSwitchName"}
...etc.
I have (for example) a stats panel.
I can use the “labels to fields” transform
to get
or this
But would like to have BOTH fields “switch_ids” and “switch_name” in the label instead of one or the other.
Thanks in advance.