The variable value is entered as 'true' instead of true in the Infuxdb Query Wizard. so no data comes out because of single quotation marks

Hi, guys

I have used grafana version 10.1.5, which is connected to InfluxDB. TRUE is input as ‘True’ when using Variable in Influxdb Query Wizard to output a metrics corresponding to the boolean type True value to the graph. And the graph does not print and the no data comes out.

Steps

  1. Create a variable to output the value matched to the boolean type true

  2. After choosing “build_result”::field in Query Wizard, Select a variable " created in STEP1.

  3. No data comes out in the graph panel.

  4. Click the pencil icon to check the Query statement. The value is as shown below. as you can see, there is a single quotation mark.
    Query : WHERE (“build_result”::field = ‘true’)

  5. When I delete a small quotes( from ‘true’ to true), the graphs are output normally.
    Query : WHERE (“build_result”::field = true)

Variables must enter query statements without single quotes to function normally.

Is this a graphana error? How can I make the boolean values appear in the graph panel using Variable?

Any ideas? Much appreciated…

###################################################

  • What Grafana version and what operating system are you using?
    Grafana Version 10.1.5 / OS : Ubuntu 20.04

  • What are you trying to achieve?
    To print influxdb data to graph panel properly

  • How are you trying to achieve it?

  1. Create a variable to output the value matched to the boolean type true
  2. After choosing “build_result”::field in Query Wizard, Select a variable " created in STEP1.
  • What happened?
    no data comes out

  • What did you expect to happen?
    influxdb data should be printed in graph panel

  • Can you copy/paste the configuration(s) that you are having problems with?

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

  • Did you follow any online instructions? If so, what is the URL?

What data type is build_result boolean or string?

What happens if you change the value of status to 1 instead of true

Grafana is doing formatting of that variable (e.g. adding quotes in this case). If you need exactly the same value as you entered, then use advanced variable formatting and use raw format, e.g. ${status:raw} and not just $status:

2 Likes