Up to this point I have the correct result, all hosts appear, but the problem is that I am not able to obtain the results according to the filtering of the selected host:
When I enter the hostname, I have the correct data, I would like to know if it is possible to make it work, when changing the Host, return the metric related to it.
inserting filter(fn: (r) => r.host == “$host” does not generate errors but I believe that the query searches for the host with the name “$host” and the result is null
Unfortunately https://play.grafana.org/ for InfluxDB is created and linked with a database of Influx 1.5 or less if I am not mistaken, the queries are totally different, in any case I am still investigating, thank you again.
Hi @marcelrissardi, Have you fixed this issue? I have the same problem with this thread and I tried long time to fixed it but all failed.
Below is my step. ( Grafana7.3+Influxdb2.0-rc3)
When I add a tag filter in the query cmd (add 'r.host == "${host}"'), the grafana has the right action. No matter which one host I selecte, it shows the right host data. But if I select more than one host, it shows no data (no error shows).
Because you use several values, it’s line IN in SQL.
If you use exact single value, not multiple value, you can use “==” ,for safety, better use “=~” instead
Hi @fadjar340,
Thank you for your reply. I also tried this .
When I add r.host =~ "${host}" the error msg shows "invalid: type error @5:15-5:30: expected regexp but found string".
When i add r.host =~ ${host}" the error msg shows "invalid: error @5:22-5:27: undefined identifier host2"