Format as Table with InfluxDB 2 and flux query syntax

Hi Grafana Community :heartbeat: !
I have a question regarding following setup:

Grafana v7.5
InfluxDB 2
Datasource: InfluxDB
Query Language: Flux

With InfluxQL there was the possibility to format the query results as Table:
Bildschirmfoto vom 2021-02-05 18-53-22

Is there a way to do this with the new Flux Queries ?

I have latitude, longitude (or geohash) in my influxDB 2 and want to use the Worldmap Panel plugin for Grafana | Grafana Labs with this geo data. Unfortunately I only got it working with the Table format (not wirh the timeseries format which i get from my Flux queries). But I would like to stay with the flux query language and do not like to go back to InfluxQL.

Anyone any idea about this ?
cheers, tobi

1 Like

Bumping this as I’m in exactly the same boat. I’m pushing to InfluxDB v2 time series data with the fields “geohash”, “city”, “count”, which I’d like to display on the world map plugin. So far I’ve only been able to display the last (or first) data point on the map using the following Flux query:

from(bucket: "planck")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "fail2ban_ips")
  |> filter(fn: (r) => r["host"] == "planck")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)

A transformation also has to be applied: “Outer Join” by “Time”. But I couldn’t get multiple data points to be displayed at the same time.

Hello all,
I’am in the same “boat”
I managed to get some data form to fields in 1 Table, although i get way more columns then i want. Theze can be hidden, but i rather have only

Time, WegerTeller and WegerZakGew
Below is my code, i hope somenone can point me to make this “smarter”

s1 = from(bucket: "Test1")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "Afzakker" and r._field == "WegerTeller")
|> group(columns: ["_time", "_measurement", "_field", "_value"], mode: "except")

s2 = from(bucket: "Test1")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "Afzakker" and r._field == "WegerZakGew")
|> group(columns: ["_time", "_measurement", "_field", "_value"], mode: "except")

tables: {WegerTeller:s1, WegerZakGew:s2},
on: ["_time",  "host"]

On the picture below you can see i have to hide lots of columns, i need only the 3 witch are not hidden.

perhaps this thread will be of use.

I would explore trying a transformation like labels to fields or outer join.

1 Like