mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 23:53:25 -06:00
Docs: InfluxDB variable in query (#24861)
First example of the use of a variable in influxdb query should not use a regex query but a simple one. A first time influxdb user (like me) could think that the proper way to use variable in a dashboard template is to use regex query, but it's not true. Also "=~ /$region/" may be erroniously thought identical to "= '$region'" while instead "=~ /^$region$/" is identical to "= '$region'", and for that type of query is useless (if not slower) use a regex query.
This commit is contained in:
parent
ead259f26d
commit
ad589c3201
@ -162,7 +162,7 @@ You can also create nested variables. For example if you had another variable, f
|
||||
the hosts variable only show hosts from the current selected region with a query like this:
|
||||
|
||||
```sql
|
||||
SHOW TAG VALUES WITH KEY = "hostname" WHERE region =~ /$region/
|
||||
SHOW TAG VALUES WITH KEY = "hostname" WHERE region = '$region'
|
||||
```
|
||||
|
||||
You can fetch key names for a given measurement.
|
||||
|
Loading…
Reference in New Issue
Block a user