Not able to use the "-value" field in grafana / Influx query

Hi all, apologies for what might be a rather basic question.

I am pushing telemetry from a Cisco device to Influx / Grafana to setup a dashboard that tells me when Access Points (Wifi AP’s) are online or offline.

Ive found the telemetry subscription I want which populates the “_field” group string named “is_joined”.

What im interesting in is the “no group bolean” next to the group string called “_value”:

When the value is “true” the AP is online, when “false” its offline.

With the standard single stat within Influx, it only seems to want to use the “is-joined” group string.

How do I get grafana to use the no group bolean “-value” instead so i can map:
“true” to something like UP
“false” to something like DOWN

Thanks in advance

Hi @kalahari and welcome to the Grafana forum.

The way Grafana parses the result from InfluxDB is that if a _value column is found, it is assumed to be a time-series. The quick workaround is to add the following rename() function:

 |> rename(columns: {_value: "something"})

Can you try that and report back? You may have to experiment where in your Flux query to place the above statement.

Hi @grant2! Many thanks for the welcome.

So I’ve added the rename function to my flux query per your suggestion (tried a few difference places) and it has indeed renamed the “_value” to the value I specified “_ap_joined”

I’ve dumped that query into Grafana but I dont seem to get anything back other than “no data”

Is there something else I should be doing in the standard options / value mappings maybe?

Hi @kalahari

Can you add a filter statement like this just after the rename line and see if that displays anything in Grafana?
|> filter(fn: (r) => r["_ap_joined"] == "false")

Hi @grant2, apologies for the delay in reply.

I managed to get this working using a stat visualisation.
Under Value options, setting calculation to “last”, fields to the “is_joined” value listed in the drop down and then creating two value mappings to rename true to “up” & false to “down”.

Works like a charm so far.

Many thanks for the sanity check.

Cheers