Panel titles and metric queries can refer to variables using two different syntaxes:
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. For example, a variable used in a regex expression will be regex escaped. Read the data source specific documentation topic for details on value escaping during interpolation.
For advanced syntax to override data source default formatting, refer to Advanced variable format options.
The formatting of the variable interpolation depends on the data source, but there are some situations where you might want to change the default formatting.
For example, the default for the MySql data source is to join multiple values as comma-separated with quotes: 'server01','server02'. In some cases, you might want to have a comma-separated string without quotes: server01,server02. You can make that happen with advanced variable formatting options listed below.
Syntax: ${var_name:option}
If any invalid formatting option is specified, then glob is the default/fallback option.
An alternative syntax (that might be deprecated in the future) is [[var_name:option]].
Formats variables with multiple values as a comma-separated string.
Formats variables with multiple values in custom format for OpenTSDB.
Formats single-and multi-valued variables into a comma-separated string, escapes " in each value by \" and quotes each value with ".
Formats variables with multiple values as a comma-separated string.
Formats single and multi valued variables for use in URL parameters.
Formats variables with multiple values into a pipe-separated string.
Turns off datasource-specific formatting, such as single quotes in an SQL query.
Formats variables with multiple values into a regex string.
Formats single-and multi-valued variables into a comma-separated string, escapes ' in each value by \' and quotes each value with '.
Formats single-and multi-valued variables into a comma-separated string, escapes ' in each value by '' and quotes each value with '.
Formats single-and multi-valued variables into their text representation. For a single variable it will just return the text representation. For multi-valued variables it will return the text representation combined with +.
Formats single-and multi-valued variables into their query parameter representation. Example: var-foo=value1&var-foo=value2