Commit ad589c32 by Alcarin Committed by GitHub

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.
parent ead259f2
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment