<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Templates and variables on Grafana Labs</title><link>https://grafana.com/docs/grafana/v7.5/variables/</link><description>Recent content in Templates and variables on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v7.5/variables/index.xml" rel="self" type="application/rss+xml"/><item><title>Variable syntax</title><link>https://grafana.com/docs/grafana/v7.5/variables/syntax/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/syntax/</guid><content><![CDATA[&lt;h1 id=&#34;variable-syntax&#34;&gt;Variable syntax&lt;/h1&gt;
&lt;p&gt;Panel titles and metric queries can refer to variables using two different syntaxes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$varname&lt;/code&gt;
This syntax is easy to read, but it does not allow you to use a variable in the middle of a word.
&lt;strong&gt;Example:&lt;/strong&gt; apps.frontend.$server.requests.count&lt;/li&gt;
&lt;li&gt;&lt;code&gt;${var_name}&lt;/code&gt; Use this syntax when you want to interpolate a variable in the middle of an expression.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;${var_name:&amp;lt;format&amp;gt;}&lt;/code&gt; This format gives you more control over how Grafana interpolates values. Refer to &lt;a href=&#34;../advanced-variable-format-options/&#34;&gt;Advanced variable format options&lt;/a&gt; for more detail on all the formatting types.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[[varname]]&lt;/code&gt; Do not use. Deprecated old syntax, will be removed in a future release.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before queries are sent to your data source the query is &lt;em&gt;interpolated&lt;/em&gt;, meaning the variable is replaced with its current value. During
interpolation, the variable value might be &lt;em&gt;escaped&lt;/em&gt; 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 in an InfluxDB or Prometheus query will be regex escaped. Read the data source specific
documentation topic for details on value escaping during interpolation.&lt;/p&gt;
&lt;p&gt;For advanced syntax to override data source default formatting, refer to &lt;a href=&#34;../advanced-variable-format-options/&#34;&gt;Advanced variable format options&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="variable-syntax">Variable syntax&lt;/h1>
&lt;p>Panel titles and metric queries can refer to variables using two different syntaxes:&lt;/p>
&lt;ul>
&lt;li>&lt;code>$varname&lt;/code>
This syntax is easy to read, but it does not allow you to use a variable in the middle of a word.
&lt;strong>Example:&lt;/strong> apps.frontend.$server.requests.count&lt;/li>
&lt;li>&lt;code>${var_name}&lt;/code> Use this syntax when you want to interpolate a variable in the middle of an expression.&lt;/li>
&lt;li>&lt;code>${var_name:&amp;lt;format&amp;gt;}&lt;/code> This format gives you more control over how Grafana interpolates values. Refer to &lt;a href="../advanced-variable-format-options/">Advanced variable format options&lt;/a> for more detail on all the formatting types.&lt;/li>
&lt;li>&lt;code>[[varname]]&lt;/code> Do not use. Deprecated old syntax, will be removed in a future release.&lt;/li>
&lt;/ul>
&lt;p>Before queries are sent to your data source the query is &lt;em>interpolated&lt;/em>, meaning the variable is replaced with its current value. During
interpolation, the variable value might be &lt;em>escaped&lt;/em> 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 in an InfluxDB or Prometheus query will be regex escaped. Read the data source specific
documentation topic for details on value escaping during interpolation.&lt;/p></description></item><item><title>Manage variables</title><link>https://grafana.com/docs/grafana/v7.5/variables/manage-variable/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/manage-variable/</guid><content><![CDATA[&lt;h1 id=&#34;manage-variables&#34;&gt;Manage variables&lt;/h1&gt;
&lt;p&gt;The variables page lets you &lt;a href=&#34;../variable-types/&#34;&gt;add&lt;/a&gt; variables and manage existing variables. It also allows you to &lt;a href=&#34;../inspect-variable/&#34;&gt;inspect&lt;/a&gt; variables and identify whether a variable is being referenced (or used) in other variables or dashboard.&lt;/p&gt;
&lt;h2 id=&#34;move&#34;&gt;Move&lt;/h2&gt;
&lt;p&gt;You can move a variable up or down the list using the up and down arrows respectively.&lt;/p&gt;
&lt;h2 id=&#34;clone&#34;&gt;Clone&lt;/h2&gt;
&lt;p&gt;To clone a variable, click the clone icon from the set of icons on the right. This creates a copy of the variable with the name of the original variable prefixed with &lt;code&gt;copy_of_&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;delete&#34;&gt;Delete&lt;/h2&gt;
&lt;p&gt;To delete a variable, click the trash icon from the set of icons on the right.&lt;/p&gt;
]]></content><description>&lt;h1 id="manage-variables">Manage variables&lt;/h1>
&lt;p>The variables page lets you &lt;a href="../variable-types/">add&lt;/a> variables and manage existing variables. It also allows you to &lt;a href="../inspect-variable/">inspect&lt;/a> variables and identify whether a variable is being referenced (or used) in other variables or dashboard.&lt;/p></description></item><item><title>Inspect variables</title><link>https://grafana.com/docs/grafana/v7.5/variables/inspect-variable/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/inspect-variable/</guid><content><![CDATA[&lt;h1 id=&#34;inspect-variables-and-their-dependencies&#34;&gt;Inspect variables and their dependencies&lt;/h1&gt;
&lt;p&gt;The variables page lets you easily identify whether a variable is being referenced (or used) in other variables or dashboard. In addition, you can also &lt;a href=&#34;../variable-types/&#34;&gt;add&lt;/a&gt; variables and &lt;a href=&#34;../manage-variable/&#34;&gt;manage&lt;/a&gt; existing variables from this page.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is available in Grafana 7.4 and later versions.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/variables-templates/variables-list-7-4.png&#34;
  alt=&#34;Variables list&#34; width=&#34;2624&#34;
     height=&#34;830&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Any variable that is referenced or used has a green check mark next to it, while unreferenced variables have a orange caution icon next to them.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/variables-templates/variable-not-referenced-7-4.png&#34;
  alt=&#34;Variables list&#34; width=&#34;714&#34;
     height=&#34;122&#34;/&gt;&lt;/p&gt;
&lt;p&gt;In addition, all referenced variables have a dependency icon next to the green check mark. You can click on the icon to view the dependency map. The dependency map can be moved. You can zoom in out with mouse wheel or track pad equivalent.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/variables-templates/dependancy-map-7-4.png&#34;
  alt=&#34;Variables list&#34; width=&#34;772&#34;
     height=&#34;580&#34;/&gt;&lt;/p&gt;
]]></content><description>&lt;h1 id="inspect-variables-and-their-dependencies">Inspect variables and their dependencies&lt;/h1>
&lt;p>The variables page lets you easily identify whether a variable is being referenced (or used) in other variables or dashboard. In addition, you can also &lt;a href="../variable-types/">add&lt;/a> variables and &lt;a href="../manage-variable/">manage&lt;/a> existing variables from this page.&lt;/p></description></item><item><title>Add variables</title><link>https://grafana.com/docs/grafana/v7.5/variables/variable-types/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/variable-types/</guid><content><![CDATA[&lt;h1 id=&#34;variables-types&#34;&gt;Variables types&lt;/h1&gt;
&lt;p&gt;Grafana uses several types of variables.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Variable type&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Query&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. &lt;a href=&#34;add-query-variable/&#34;&gt;Add a query variable&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Custom&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Define the variable options manually using a comma-separated list. &lt;a href=&#34;add-custom-variable/&#34;&gt;Add a custom variable&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Text box&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Display a free text input field with an optional default value. &lt;a href=&#34;add-text-box-variable/&#34;&gt;Add a text box variable&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Constant&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Define a hidden constant. &lt;a href=&#34;add-constant-variable/&#34;&gt;Add a constant variable&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Data source&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Quickly change the data source for an entire dashboard. &lt;a href=&#34;add-data-source-variable/&#34;&gt;Add a data source variable&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Interval&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Interval variables represent time spans. &lt;a href=&#34;add-interval-variable/&#34;&gt;Add an interval variable&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Ad hoc filters&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Key/value filters that are automatically added to all metric queries for a data source (InfluxDB, Prometheus, and Elasticsearch only). &lt;a href=&#34;add-ad-hoc-filters/&#34;&gt;Add ad hoc filters&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Global variables&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Built-in variables that can be used in expressions in the query editor. Refer to &lt;a href=&#34;global-variables/&#34;&gt;Global variables&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Chained variables&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Variable queries can contain other variables. Refer to &lt;a href=&#34;chained-variables/&#34;&gt;Chained variables&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="variables-types">Variables types&lt;/h1>
&lt;p>Grafana uses several types of variables.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th style="text-align: left">Variable type&lt;/th>
&lt;th style="text-align: left">Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td style="text-align: left">Query&lt;/td>
&lt;td style="text-align: left">Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. &lt;a href="add-query-variable/">Add a query variable&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Custom&lt;/td>
&lt;td style="text-align: left">Define the variable options manually using a comma-separated list. &lt;a href="add-custom-variable/">Add a custom variable&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Text box&lt;/td>
&lt;td style="text-align: left">Display a free text input field with an optional default value. &lt;a href="add-text-box-variable/">Add a text box variable&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Constant&lt;/td>
&lt;td style="text-align: left">Define a hidden constant. &lt;a href="add-constant-variable/">Add a constant variable&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Data source&lt;/td>
&lt;td style="text-align: left">Quickly change the data source for an entire dashboard. &lt;a href="add-data-source-variable/">Add a data source variable&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Interval&lt;/td>
&lt;td style="text-align: left">Interval variables represent time spans. &lt;a href="add-interval-variable/">Add an interval variable&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Ad hoc filters&lt;/td>
&lt;td style="text-align: left">Key/value filters that are automatically added to all metric queries for a data source (InfluxDB, Prometheus, and Elasticsearch only). &lt;a href="add-ad-hoc-filters/">Add ad hoc filters&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Global variables&lt;/td>
&lt;td style="text-align: left">Built-in variables that can be used in expressions in the query editor. Refer to &lt;a href="global-variables/">Global variables&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: left">Chained variables&lt;/td>
&lt;td style="text-align: left">Variable queries can contain other variables. Refer to &lt;a href="chained-variables/">Chained variables&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>Variable examples</title><link>https://grafana.com/docs/grafana/v7.5/variables/variable-examples/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/variable-examples/</guid><content><![CDATA[&lt;h1 id=&#34;variable-examples&#34;&gt;Variable examples&lt;/h1&gt;
&lt;p&gt;This page contains links to dashboards in Grafana Play with examples of template variables.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000014/elasticsearch-metrics?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Elasticsearch Metrics&lt;/a&gt; - Uses ad hoc filters, global variables, and a custom variable.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000056/graphite-templated-nested?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Graphite Templated Nested&lt;/a&gt; - Uses query variables, chained query variables, an interval variable, and a repeated panel.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000137/influxdb-group-by-variable?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Influx DB Group By Variable&lt;/a&gt; - Query variable, panel uses the variable results to group the metric data.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000083/influxdb-raw-query-template-var?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;InfluxDB Raw Query Template Var&lt;/a&gt; - Uses query variables, chained query variables, and an interval variable.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/AAy9r_bmk/influxdb-server-monitoring?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;InfluxDB Server Monitoring&lt;/a&gt; - Uses query variables, chained query variables, an interval variable, and an ad hoc filter.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000063/prometheus-templating?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus templating&lt;/a&gt; - Uses chained query variables.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/p-k6QtkGz/template-redux?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Template Redux&lt;/a&gt; - Uses query variables, chained query variables, ad hoc filters, an interval variable, a text box variable, a custom variable, and a data source variable.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000025/templating-repeated-panels?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Templating, repeated panels&lt;/a&gt; - Two sets of repeated panels use query variables.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000091/templating-showcase?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Templating showcase&lt;/a&gt; - Uses custom, query, chained query, and data source variables.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000024/templating-value-groups?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Templating value groups&lt;/a&gt; - Uses query variable with value groups.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="variable-examples">Variable examples&lt;/h1>
&lt;p>This page contains links to dashboards in Grafana Play with examples of template variables.&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://play.grafana.org/d/000000014/elasticsearch-metrics?orgId=1" target="_blank" rel="noopener noreferrer">Elasticsearch Metrics&lt;/a> - Uses ad hoc filters, global variables, and a custom variable.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/000000056/graphite-templated-nested?orgId=1" target="_blank" rel="noopener noreferrer">Graphite Templated Nested&lt;/a> - Uses query variables, chained query variables, an interval variable, and a repeated panel.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/000000137/influxdb-group-by-variable?orgId=1" target="_blank" rel="noopener noreferrer">Influx DB Group By Variable&lt;/a> - Query variable, panel uses the variable results to group the metric data.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/000000083/influxdb-raw-query-template-var?orgId=1" target="_blank" rel="noopener noreferrer">InfluxDB Raw Query Template Var&lt;/a> - Uses query variables, chained query variables, and an interval variable.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/AAy9r_bmk/influxdb-server-monitoring?orgId=1" target="_blank" rel="noopener noreferrer">InfluxDB Server Monitoring&lt;/a> - Uses query variables, chained query variables, an interval variable, and an ad hoc filter.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/000000063/prometheus-templating?orgId=1" target="_blank" rel="noopener noreferrer">Prometheus templating&lt;/a> - Uses chained query variables.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/p-k6QtkGz/template-redux?orgId=1" target="_blank" rel="noopener noreferrer">Template Redux&lt;/a> - Uses query variables, chained query variables, ad hoc filters, an interval variable, a text box variable, a custom variable, and a data source variable.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/000000025/templating-repeated-panels?orgId=1" target="_blank" rel="noopener noreferrer">Templating, repeated panels&lt;/a> - Two sets of repeated panels use query variables.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/000000091/templating-showcase?orgId=1" target="_blank" rel="noopener noreferrer">Templating showcase&lt;/a> - Uses custom, query, chained query, and data source variables.&lt;/li>
&lt;li>&lt;a href="https://play.grafana.org/d/000000024/templating-value-groups?orgId=1" target="_blank" rel="noopener noreferrer">Templating value groups&lt;/a> - Uses query variable with value groups.&lt;/li>
&lt;/ul></description></item><item><title>Variable selection options</title><link>https://grafana.com/docs/grafana/v7.5/variables/variable-selection-options/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/variable-selection-options/</guid><content><![CDATA[&lt;h1 id=&#34;configure-variable-selection-options&#34;&gt;Configure variable selection options&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Selection Options&lt;/strong&gt; are a feature you can use to manage variable option selections. All selection options are optional, and they are off by default.&lt;/p&gt;
&lt;h2 id=&#34;multi-value&#34;&gt;Multi-value&lt;/h2&gt;
&lt;p&gt;If you turn this on, then the variable dropdown list allows users to select multiple options at the same time. For more information, refer to &lt;a href=&#34;../formatting-multi-value-variables/&#34;&gt;Formatting multi-value variables&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;include-all-option&#34;&gt;Include All option&lt;/h2&gt;
&lt;p&gt;Grafana adds an &lt;code&gt;All&lt;/code&gt; option to the variable dropdown list. If a user selects this option, then all variable options are selected.&lt;/p&gt;
&lt;h2 id=&#34;custom-all-value&#34;&gt;Custom all value&lt;/h2&gt;
&lt;p&gt;This option is only visible if the &lt;strong&gt;Include All option&lt;/strong&gt; is selected.&lt;/p&gt;
&lt;p&gt;Enter regex, globs, or lucene syntax in the &lt;strong&gt;Custom all value&lt;/strong&gt; field to define the value of the &lt;code&gt;All&lt;/code&gt; option.&lt;/p&gt;
&lt;p&gt;By default the &lt;code&gt;All&lt;/code&gt; value includes all options in combined expression. This can become very long and can have performance problems. Sometimes it can be better to specify a custom all value, like a wildcard regex.&lt;/p&gt;
&lt;p&gt;In order to have custom regex, globs, or lucene syntax in the &lt;strong&gt;Custom all value&lt;/strong&gt; option, it is never escaped so you will have to think about what is a valid value for your data source.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-variable-selection-options">Configure variable selection options&lt;/h1>
&lt;p>&lt;strong>Selection Options&lt;/strong> are a feature you can use to manage variable option selections. All selection options are optional, and they are off by default.&lt;/p></description></item><item><title>Variable value group tags</title><link>https://grafana.com/docs/grafana/v7.5/variables/variable-value-tags/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/variable-value-tags/</guid><content><![CDATA[&lt;h1 id=&#34;configure-variable-value-group-tags&#34;&gt;Configure variable value group tags&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This is an experimental feature that will be deprecated in Grafana v8.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Value groups/tags are a feature you can use to organize variable options. If you have many options in the dropdown for a multi-value variable, then you can use this feature to group the values into selectable tags.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 300px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/v50/variable_dropdown_tags.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/v50/variable_dropdown_tags.png&#34;data-srcset=&#34;/static/img/docs/v50/variable_dropdown_tags.png?w=320 320w, /static/img/docs/v50/variable_dropdown_tags.png?w=550 550w, /static/img/docs/v50/variable_dropdown_tags.png?w=750 750w, /static/img/docs/v50/variable_dropdown_tags.png?w=900 900w, /static/img/docs/v50/variable_dropdown_tags.png?w=1040 1040w, /static/img/docs/v50/variable_dropdown_tags.png?w=1240 1240w, /static/img/docs/v50/variable_dropdown_tags.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;734&#34;height=&#34;768&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v50/variable_dropdown_tags.png&#34;
            alt=&#34;&#34;width=&#34;734&#34;height=&#34;768&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;This feature is off by default. Click &lt;strong&gt;Enabled&lt;/strong&gt; to turn the feature on.&lt;/p&gt;
&lt;p&gt;To see an example, check out &lt;a href=&#34;https://play.grafana.org/d/000000024/templating-value-groups?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Templating value groups&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;tags-query&#34;&gt;Tags query&lt;/h2&gt;
&lt;p&gt;Enter a data source query that should return a list of tags. The tags query returns a list of tags that each represents a group, and the tag values query returns a list of group members.&lt;/p&gt;
&lt;p&gt;For example, the tags query could be a list of regions (Europe, Asia, Americas), and then if the user selects the Europe tag, then the tag values query would return a list of countries &amp;ndash; Sweden, Germany, France, and so on.&lt;/p&gt;
&lt;p&gt;If you have a variable with a lot of values (say all the countries in the world), then this allows you to easily select a group of them. If the user selects the tag Europe, all the countries in Europe would be selected.&lt;/p&gt;
&lt;p&gt;In this &lt;a href=&#34;https://play.grafana.org/d/ZUPhFVGGk/graphite-with-experimental-tags?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;example dashboard&lt;/a&gt;, the server variable has tags enabled.&lt;/p&gt;
&lt;h2 id=&#34;tag-values-query&#34;&gt;Tag values query&lt;/h2&gt;
&lt;p&gt;Enter a data source query that should return a list of values for a specified tag key. Use &lt;code&gt;$tag&lt;/code&gt; in the query to refer to the currently selected tag.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;$tag&lt;/code&gt; variable will have the value of the tag that the user chooses.&lt;/p&gt;
&lt;p&gt;For example, if you have a Graphite query for tags, &lt;code&gt;regions.*&lt;/code&gt;, that returns a list of regions. The values query could be &lt;code&gt;regions.$tag.*&lt;/code&gt;, which if the user chooses Europe would be interpolated to &lt;code&gt;regions.Europe.*&lt;/code&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-variable-value-group-tags">Configure variable value group tags&lt;/h1>
&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> This is an experimental feature that will be deprecated in Grafana v8.&lt;/p>&lt;/blockquote>
&lt;p>Value groups/tags are a feature you can use to organize variable options. If you have many options in the dropdown for a multi-value variable, then you can use this feature to group the values into selectable tags.&lt;/p></description></item><item><title>Advanced variable format options</title><link>https://grafana.com/docs/grafana/v7.5/variables/advanced-variable-format-options/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/advanced-variable-format-options/</guid><content><![CDATA[&lt;h1 id=&#34;advanced-variable-format-options&#34;&gt;Advanced variable format options&lt;/h1&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;For example, the default for the MySql data source is to join multiple values as comma-separated with quotes: &lt;code&gt;&#39;server01&#39;,&#39;server02&#39;&lt;/code&gt;. In some cases, you might want to have a comma-separated string without quotes: &lt;code&gt;server01,server02&lt;/code&gt;. You can make that happen with advanced variable formatting options listed below.&lt;/p&gt;
&lt;h2 id=&#34;general-syntax&#34;&gt;General syntax&lt;/h2&gt;
&lt;p&gt;Syntax: &lt;code&gt;${var_name:option}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Test the formatting options on the &lt;a href=&#34;https://play.grafana.org/d/cJtIfcWiz/template-variable-formatting-options?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Play site&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If any invalid formatting option is specified, then &lt;code&gt;glob&lt;/code&gt; is the default/fallback option.&lt;/p&gt;
&lt;p&gt;An alternative syntax (that might be deprecated in the future) is &lt;code&gt;[[var_name:option]]&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;csv&#34;&gt;CSV&lt;/h2&gt;
&lt;p&gt;Formats variables with multiple values as a comma-separated string.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:csv}&amp;#39;
Interpolation result: &amp;#39;test1,test2&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;distributed---opentsdb&#34;&gt;Distributed - OpenTSDB&lt;/h2&gt;
&lt;p&gt;Formats variables with multiple values in custom format for OpenTSDB.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:distributed}&amp;#39;
Interpolation result: &amp;#39;test1,servers=test2&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;doublequote&#34;&gt;Doublequote&lt;/h2&gt;
&lt;p&gt;Formats single- and multi-valued variables into a comma-separated string, escapes &lt;code&gt;&amp;quot;&lt;/code&gt; in each value by &lt;code&gt;\&amp;quot;&lt;/code&gt; and quotes each value with &lt;code&gt;&amp;quot;&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:doublequote}&amp;#39;
Interpolation result: &amp;#39;&amp;#34;test1&amp;#34;,&amp;#34;test2&amp;#34;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;glob---graphite&#34;&gt;Glob - Graphite&lt;/h2&gt;
&lt;p&gt;Formats variables with multiple values into a glob (for Graphite queries).&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:glob}&amp;#39;
Interpolation result: &amp;#39;{test1,test2}&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;json&#34;&gt;JSON&lt;/h2&gt;
&lt;p&gt;Formats variables with multiple values as a comma-separated string.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:json}&amp;#39;
Interpolation result: &amp;#39;[&amp;#34;test1&amp;#34;, &amp;#34;test2&amp;#34;]&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;lucene---elasticsearch&#34;&gt;Lucene - Elasticsearch&lt;/h2&gt;
&lt;p&gt;Formats variables with multiple values in Lucene format for Elasticsearch.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:lucene}&amp;#39;
Interpolation result: &amp;#39;(&amp;#34;test1&amp;#34; OR &amp;#34;test2&amp;#34;)&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;percentencode&#34;&gt;Percentencode&lt;/h2&gt;
&lt;p&gt;Formats single and multi valued variables for use in URL parameters.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;foo()bar BAZ&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:percentencode}&amp;#39;
Interpolation result: &amp;#39;foo%28%29bar%20BAZ%2Ctest2&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;pipe&#34;&gt;Pipe&lt;/h2&gt;
&lt;p&gt;Formats variables with multiple values into a pipe-separated string.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1.&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:pipe}&amp;#39;
Interpolation result: &amp;#39;test1.|test2&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;raw&#34;&gt;Raw&lt;/h2&gt;
&lt;p&gt;Turns off data source-specific formatting, such as single quotes in an SQL query.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test.1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${var_name:raw}&amp;#39;
Interpolation result: &amp;#39;test.1,test2&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;regex&#34;&gt;Regex&lt;/h2&gt;
&lt;p&gt;Formats variables with multiple values into a regex string.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1.&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:regex}&amp;#39;
Interpolation result: &amp;#39;(test1\.|test2)&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;singlequote&#34;&gt;Singlequote&lt;/h2&gt;
&lt;p&gt;Formats single- and multi-valued variables into a comma-separated string, escapes &lt;code&gt;&#39;&lt;/code&gt; in each value by &lt;code&gt;\&#39;&lt;/code&gt; and quotes each value with &lt;code&gt;&#39;&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#39;test1&amp;#39;, &amp;#39;test2&amp;#39;]
String to interpolate: &amp;#39;${servers:singlequote}&amp;#39;
Interpolation result: &amp;#34;&amp;#39;test1&amp;#39;,&amp;#39;test2&amp;#39;&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;sqlstring&#34;&gt;Sqlstring&lt;/h2&gt;
&lt;p&gt;Formats single- and multi-valued variables into a comma-separated string, escapes &lt;code&gt;&#39;&lt;/code&gt; in each value by &lt;code&gt;&#39;&#39;&lt;/code&gt; and quotes each value with &lt;code&gt;&#39;&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#34;test&amp;#39;1&amp;#34;, &amp;#34;test2&amp;#34;]
String to interpolate: &amp;#39;${servers:sqlstring}&amp;#39;
Interpolation result: &amp;#34;&amp;#39;test&amp;#39;&amp;#39;1&amp;#39;,&amp;#39;test2&amp;#39;&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;text&#34;&gt;Text&lt;/h2&gt;
&lt;p&gt;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 &lt;code&gt;&#43;&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#34;test1&amp;#34;, &amp;#34;test2&amp;#34;]
String to interpolate: &amp;#39;${servers:text}&amp;#39;
Interpolation result: &amp;#34;test1 &amp;#43; test2&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-parameters&#34;&gt;Query parameters&lt;/h2&gt;
&lt;p&gt;Formats single- and multi-valued variables into their query parameter representation. Example: &lt;code&gt;var-foo=value1&amp;amp;var-foo=value2&lt;/code&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;servers = [&amp;#34;test1&amp;#34;, &amp;#34;test2&amp;#34;]
String to interpolate: &amp;#39;${servers:queryparam}&amp;#39;
Interpolation result: &amp;#34;var-servers=test1&amp;amp;var-servers=test2&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="advanced-variable-format-options">Advanced variable format options&lt;/h1>
&lt;p>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.&lt;/p></description></item><item><title>Multi-value variables</title><link>https://grafana.com/docs/grafana/v7.5/variables/formatting-multi-value-variables/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/formatting-multi-value-variables/</guid><content><![CDATA[&lt;h1 id=&#34;multi-value-variables&#34;&gt;Multi-value variables&lt;/h1&gt;
&lt;p&gt;Interpolating a variable with multiple values selected is tricky as it is not straight forward how to format the multiple values into a string that is valid in the given context where the variable is used. Grafana tries to solve this by allowing each data source plugin to inform the templating interpolation engine what format to use for multiple values.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The &lt;strong&gt;Custom all value&lt;/strong&gt; option on the variable must be blank for Grafana to format all values into a single string. If leave it blank, then the Grafana concatenates (adds together) all the values in the query. Something like &lt;code&gt;value1,value2,value3&lt;/code&gt;. If a custom &lt;code&gt;all&lt;/code&gt; value is used, then instead the value will be something like &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;all&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;multi-value-variables-with-a-graphite-data-source&#34;&gt;Multi-value variables with a Graphite data source&lt;/h2&gt;
&lt;p&gt;Graphite uses glob expressions. A variable with multiple values would, in this case, be interpolated as &lt;code&gt;{host1,host2,host3}&lt;/code&gt; if the current variable value was &lt;em&gt;host1&lt;/em&gt;, &lt;em&gt;host2&lt;/em&gt;, and &lt;em&gt;host3&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&#34;multi-value-variables-with-a-prometheus-or-influxdb-data-source&#34;&gt;Multi-value variables with a Prometheus or InfluxDB data source&lt;/h2&gt;
&lt;p&gt;InfluxDB and Prometheus use regex expressions, so the same variable would be interpolated as &lt;code&gt;(host1|host2|host3)&lt;/code&gt;. Every value would also be regex escaped. If not, a value with a regex control character would break the regex expression.&lt;/p&gt;
&lt;h2 id=&#34;multi-value-variables-with-an-elastic-data-source&#34;&gt;Multi-value variables with an Elastic data source&lt;/h2&gt;
&lt;p&gt;Elasticsearch uses lucene query syntax, so the same variable would be formatted as &lt;code&gt;(&amp;quot;host1&amp;quot; OR &amp;quot;host2&amp;quot; OR &amp;quot;host3&amp;quot;)&lt;/code&gt;. In this case, every value must be escaped so that the value only contains lucene control words and quotation marks.&lt;/p&gt;
&lt;h2 id=&#34;troubleshoot-multi-value-variables&#34;&gt;Troubleshoot multi-value variables&lt;/h2&gt;
&lt;p&gt;Automatic escaping and formatting can cause problems and it can be tricky to grasp the logic behind it. Especially for InfluxDB and Prometheus where the use of regex syntax requires that the variable is used in regex operator context.&lt;/p&gt;
&lt;p&gt;If you do not want Grafana to do this automatic regex escaping and formatting, then you must do one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Turn off the &lt;strong&gt;Multi-value&lt;/strong&gt; or &lt;strong&gt;Include All option&lt;/strong&gt; options.&lt;/li&gt;
&lt;li&gt;Use the &lt;a href=&#34;../advanced-variable-format-options/#raw&#34;&gt;raw variable format&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="multi-value-variables">Multi-value variables&lt;/h1>
&lt;p>Interpolating a variable with multiple values selected is tricky as it is not straight forward how to format the multiple values into a string that is valid in the given context where the variable is used. Grafana tries to solve this by allowing each data source plugin to inform the templating interpolation engine what format to use for multiple values.&lt;/p></description></item><item><title>Filter variables with regex</title><link>https://grafana.com/docs/grafana/v7.5/variables/filter-variables-with-regex/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/filter-variables-with-regex/</guid><content><![CDATA[&lt;h1 id=&#34;filter-variables-with-regex&#34;&gt;Filter variables with regex&lt;/h1&gt;
&lt;p&gt;Using the Regex Query option, you filter the list of options returned by the variable query or modify the options returned.&lt;/p&gt;
&lt;p&gt;This page shows how to use regex to filter/modify values in the variable dropdown.&lt;/p&gt;
&lt;p&gt;Using the Regex Query Option, you filter the list of options returned by the Variable query or modify the options returned. For more information, refer to the Mozilla guide on &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Regular expressions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Examples of filtering on the following list of options:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;text&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-text&#34;&gt;backend_01
backend_02
backend_03
backend_04&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;filter-so-that-only-the-options-that-end-with-01-or-02-are-returned&#34;&gt;Filter so that only the options that end with &lt;code&gt;01&lt;/code&gt; or &lt;code&gt;02&lt;/code&gt; are returned:&lt;/h2&gt;
&lt;p&gt;Regex:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;regex&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-regex&#34;&gt;/.*[01|02]/&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Result:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;text&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-text&#34;&gt;backend_01
backend_02&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;filter-and-modify-the-options-using-a-regex-capture-group-to-return-part-of-the-text&#34;&gt;Filter and modify the options using a regex capture group to return part of the text:&lt;/h2&gt;
&lt;p&gt;Regex:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;regex&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-regex&#34;&gt;/.*(01|02)/&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Result:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;text&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-text&#34;&gt;01
02&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;filter-and-modify---prometheus-example&#34;&gt;Filter and modify - Prometheus Example&lt;/h2&gt;
&lt;p&gt;List of options:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;text&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-text&#34;&gt;up{instance=&amp;#34;demo.robustperception.io:9090&amp;#34;,job=&amp;#34;prometheus&amp;#34;} 1 1521630638000
up{instance=&amp;#34;demo.robustperception.io:9093&amp;#34;,job=&amp;#34;alertmanager&amp;#34;} 1 1521630638000
up{instance=&amp;#34;demo.robustperception.io:9100&amp;#34;,job=&amp;#34;node&amp;#34;} 1 1521630638000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Regex:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;regex&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-regex&#34;&gt;/.*instance=&amp;#34;([^&amp;#34;]*).*/&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Result:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;text&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-text&#34;&gt;demo.robustperception.io:9090
demo.robustperception.io:9093
demo.robustperception.io:9100&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;filter-and-modify-using-named-text-and-value-capture-groups&#34;&gt;Filter and modify using named text and value capture groups&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is available in Grafana 7.4&#43;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Using named capture groups, you can capture separate &amp;rsquo;text&amp;rsquo; and &amp;lsquo;value&amp;rsquo; parts from the options returned by the variable query. This allows the variable drop-down list to contain a friendly name for each value that can be selected.&lt;/p&gt;
&lt;p&gt;For example, when querying the &lt;code&gt;node_hwmon_chip_names&lt;/code&gt; Prometheus metric, the &lt;code&gt;chip_name&lt;/code&gt; is a lot friendlier that the &lt;code&gt;chip&lt;/code&gt; value. So the following variable query result:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;text&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-text&#34;&gt;node_hwmon_chip_names{chip=&amp;#34;0000:d7:00_0_0000:d8:00_0&amp;#34;,chip_name=&amp;#34;enp216s0f0np0&amp;#34;} 1
node_hwmon_chip_names{chip=&amp;#34;0000:d7:00_0_0000:d8:00_1&amp;#34;,chip_name=&amp;#34;enp216s0f0np1&amp;#34;} 1
node_hwmon_chip_names{chip=&amp;#34;0000:d7:00_0_0000:d8:00_2&amp;#34;,chip_name=&amp;#34;enp216s0f0np2&amp;#34;} 1
node_hwmon_chip_names{chip=&amp;#34;0000:d7:00_0_0000:d8:00_3&amp;#34;,chip_name=&amp;#34;enp216s0f0np3&amp;#34;} 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Passed through the following Regex:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;regex&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-regex&#34;&gt;/chip_name=&amp;#34;(?&amp;lt;text&amp;gt;[^&amp;#34;]&amp;#43;)|chip=&amp;#34;(?&amp;lt;value&amp;gt;[^&amp;#34;]&amp;#43;)/g&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Would produce the following drop-down list:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;text&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-text&#34;&gt;Display Name          Value
------------          -------------------------
enp216s0f0np0         0000:d7:00_0_0000:d8:00_0
enp216s0f0np1         0000:d7:00_0_0000:d8:00_1
enp216s0f0np2         0000:d7:00_0_0000:d8:00_2
enp216s0f0np3         0000:d7:00_0_0000:d8:00_3&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Only &lt;code&gt;text&lt;/code&gt; and &lt;code&gt;value&lt;/code&gt; capture group names are supported.&lt;/p&gt;
]]></content><description>&lt;h1 id="filter-variables-with-regex">Filter variables with regex&lt;/h1>
&lt;p>Using the Regex Query option, you filter the list of options returned by the variable query or modify the options returned.&lt;/p></description></item><item><title>Repeat panels or rows</title><link>https://grafana.com/docs/grafana/v7.5/variables/repeat-panels-or-rows/</link><pubDate>Fri, 06 Mar 2026 04:37:32 +0000</pubDate><guid>https://grafana.com/docs/grafana/v7.5/variables/repeat-panels-or-rows/</guid><content><![CDATA[&lt;h1 id=&#34;repeat-panels-or-rows&#34;&gt;Repeat panels or rows&lt;/h1&gt;
&lt;p&gt;Grafana lets you create dynamic dashboards using &lt;em&gt;template variables&lt;/em&gt;. All variables in your queries expand to the current value of the variable before the query is sent to the database. Variables let you reuse a single dashboard for all your services.&lt;/p&gt;
&lt;p&gt;Template variables can be very useful to dynamically change your queries across a whole dashboard. If you want
Grafana to dynamically create new panels or rows based on what values you have selected, you can use the &lt;em&gt;Repeat&lt;/em&gt; feature.&lt;/p&gt;
&lt;h2 id=&#34;grafana-play-examples&#34;&gt;Grafana Play examples&lt;/h2&gt;
&lt;p&gt;You can see examples in the following dashboards:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000036/prometheus-repeat&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus repeat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/000000153/repeat-rows&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Repeated Rows Dashboard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;repeating-panels&#34;&gt;Repeating panels&lt;/h2&gt;
&lt;p&gt;If you have a variable with &lt;code&gt;Multi-value&lt;/code&gt; or &lt;code&gt;Include all value&lt;/code&gt; options enabled you can choose one panel and have Grafana repeat that panel
for every selected value. You find the &lt;em&gt;Repeat&lt;/em&gt; feature under the &lt;em&gt;General tab&lt;/em&gt; in panel edit mode.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;direction&lt;/code&gt; controls how the panels will be arranged.&lt;/p&gt;
&lt;p&gt;By choosing &lt;code&gt;horizontal&lt;/code&gt; the panels will be arranged side-by-side. Grafana will automatically adjust the width
of each repeated panel so that the whole row is filled. Currently, you cannot mix other panels on a row with a repeated
panel.&lt;/p&gt;
&lt;p&gt;Set &lt;code&gt;Max per row&lt;/code&gt; to tell grafana how many panels per row you want at most. It defaults to &lt;em&gt;4&lt;/em&gt; if you don&amp;rsquo;t set anything.&lt;/p&gt;
&lt;p&gt;By choosing &lt;code&gt;vertical&lt;/code&gt; the panels will be arranged from top to bottom in a column. The width of the repeated panels will be the same as of the first panel (the original template) being repeated.&lt;/p&gt;
&lt;p&gt;Only make changes to the first panel (the original template). To have the changes take effect on all panels you need to trigger a dynamic dashboard re-build.
You can do this by either changing the variable value (that is the basis for the repeat) or reload the dashboard.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Repeating panels require variables to have one or more items selected; you cannot repeat a panel zero times to hide it.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;repeating-rows&#34;&gt;Repeating rows&lt;/h2&gt;
&lt;p&gt;As seen above with the panels you can also repeat rows if you have variables set with &lt;code&gt;Multi-value&lt;/code&gt; or
&lt;code&gt;Include all value&lt;/code&gt; selection option.&lt;/p&gt;
&lt;p&gt;To enable this feature you need to first add a new &lt;em&gt;Row&lt;/em&gt; using the &lt;em&gt;Add Panel&lt;/em&gt; menu. Then by hovering the row title and
clicking on the cog button, you will access the &lt;code&gt;Row Options&lt;/code&gt; configuration panel. You can then select the variable
you want to repeat the row for.&lt;/p&gt;
&lt;p&gt;It may be a good idea to use a variable in the row title as well.&lt;/p&gt;
]]></content><description>&lt;h1 id="repeat-panels-or-rows">Repeat panels or rows&lt;/h1>
&lt;p>Grafana lets you create dynamic dashboards using &lt;em>template variables&lt;/em>. All variables in your queries expand to the current value of the variable before the query is sent to the database. Variables let you reuse a single dashboard for all your services.&lt;/p></description></item></channel></rss>