From 3532d08cbf7855137f2b9c34416d36512d96b7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 28 May 2020 17:28:24 +0200 Subject: [PATCH] Docs: Update template variable overview to contain the preferred variable syntax (#25176) * Update templates-and-variables.md Fixes #13744 * Update templates-and-variables.md * Update templates-and-variables.md * Update docs/sources/variables/templates-and-variables.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Update docs/sources/variables/templates-and-variables.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Update docs/sources/variables/templates-and-variables.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> --- docs/sources/variables/templates-and-variables.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sources/variables/templates-and-variables.md b/docs/sources/variables/templates-and-variables.md index 653b6019698..96fb5395e87 100644 --- a/docs/sources/variables/templates-and-variables.md +++ b/docs/sources/variables/templates-and-variables.md @@ -43,9 +43,9 @@ Panel titles and metric queries can refer to variables using two different synta - `$varname` This syntax is easy to read, but it does not allow you to use a variable in the middle of a word. **Example:** apps.frontend.$server.requests.count -- `[[varname]]` - **Note:** This syntax might be deprecated in the future. - Example: apps.frontend.[[server]].requests.count +- `${var_name}` Use this syntax when you want to interpolate a variable in the middle of an expression. +- `${var_name:}` This format gives you more control over how Grafana interpolates values. Refer to [Advanced variable format options]({{< relref "advanced-variable-format-options.md" >}}) for more detail on all the formatting types. +- `[[varname]]` Do not use. Deprecated old syntax, will be removed in a future release. Before queries are sent to your data source the query is _interpolated_, meaning the variable is replaced with its current value. During interpolation, the variable value might be _escaped_ in order to conform to the syntax of the query language and where it is used.