From ad589c320180ebffaccc6c4911d578093b80f759 Mon Sep 17 00:00:00 2001 From: Alcarin Date: Wed, 20 May 2020 10:03:08 +0200 Subject: [PATCH] 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. --- docs/sources/features/datasources/influxdb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/features/datasources/influxdb.md b/docs/sources/features/datasources/influxdb.md index 0530f16d8e8..4f876cede8e 100755 --- a/docs/sources/features/datasources/influxdb.md +++ b/docs/sources/features/datasources/influxdb.md @@ -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.