Variable value being interpreted as a column name

Hi,

I am trying to create a simple dashboard, with a table to show the output of a query that uses a variable. I am connecting to a Vertica database. However, I get an error indicating that Grafana is interpreting the selected value of the variable as a column name. Please see the details below, including the screenshot, which shows the query I’ve defined.

  • What Grafana version and what operating system are you using? 10.1.2

  • What are you trying to achieve?
    Trying to create a dashboard with a variable and time filter

  • What happened?
    I get an error that suggests that Grafana is using the selected value of the variable as a column name.

  • What did you expect to happen?
    The query should match the values of a column, configuration_item_display_label, to the selected value of the variable $host

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

Thanks
-Ankit

Welcome @ankitdm

Please share the query for that variable?

Thanks @yosiasz , here is the variable query:

SELECT DISTINCT configuration_item_display_label
FROM opr_hi_duration_1d
WHERE LOWER(configuration_item_type_name) IN (‘node’)

what version of grafana is it and what is your data source. it works for me.

I’m on 10.1.2. My data source is Vertica database, using the vertica-grafana-datasource 2.1.0 plugin.

Note that the variable dropdown works for me too, but the panel doesn’t load any data, with the error I pasted in my original post. How does your query look?

Thanks
-Ankit

Thank you @yosiasz , that did the trick.

1 Like