[docs/sources/datasources] Replace docs/reference shortcode with ref URIs (#88078)
This commit is contained in:
@@ -18,6 +18,32 @@ labels:
|
||||
menuTitle: Template variables
|
||||
title: InfluxDB template variables
|
||||
weight: 300
|
||||
refs:
|
||||
add-template-variables-chained-variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#chained-variables
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#chained-variables
|
||||
variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/
|
||||
add-template-variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/
|
||||
add-template-variables-add-ad-hoc-filters:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#add-ad-hoc-filters
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#add-ad-hoc-filters
|
||||
add-template-variables-adds-a-query-variable:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#add-a-query-variable
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#add-a-query-variable
|
||||
---
|
||||
|
||||
# InfluxDB template variables
|
||||
@@ -26,14 +52,14 @@ Instead of hard-coding details such as server, application, and sensor names in
|
||||
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
|
||||
Grafana refers to such variables as template variables.
|
||||
|
||||
For an introduction to templating and template variables, refer to the [Templating][variables] and [Add and manage variables][add-template-variables] documentation.
|
||||
For an introduction to templating and template variables, refer to the [Templating](ref:variables) and [Add and manage variables](ref:add-template-variables) documentation.
|
||||
|
||||
## Use query variables
|
||||
|
||||
If you add a query template variable, you can write an InfluxDB exploration (metadata) query.
|
||||
These queries can return results like measurement names, key names, or key values.
|
||||
|
||||
For more information, refer to [Add query variable][add-template-variables-adds-a-query-variable].
|
||||
For more information, refer to [Add query variable](ref:add-template-variables-adds-a-query-variable).
|
||||
|
||||
For example, to create a variable that contains all values for tag `hostname`, specify a query like this in the query variable **Query**:
|
||||
|
||||
@@ -43,7 +69,7 @@ SHOW TAG VALUES WITH KEY = "hostname"
|
||||
|
||||
### Chain or nest variables
|
||||
|
||||
You can also create nested variables, sometimes called [chained variables][add-template-variables-chained-variables].
|
||||
You can also create nested variables, sometimes called [chained variables](ref:add-template-variables-chained-variables).
|
||||
|
||||
For example, if you had a variable called `region`, you could have the `hosts` variable show only hosts from the selected region with a query like:
|
||||
|
||||
@@ -65,7 +91,7 @@ This helps you change group-by using the variable list at the top of the dashboa
|
||||
InfluxDB supports the special **Ad hoc filters** variable type.
|
||||
You can use this variable type to specify any number of key/value filters, and Grafana applies them automatically to all of your InfluxDB queries.
|
||||
|
||||
For more information, refer to [Add ad hoc filters][add-template-variables-add-ad-hoc-filters].
|
||||
For more information, refer to [Add ad hoc filters](ref:add-template-variables-add-ad-hoc-filters).
|
||||
|
||||
## Choose a variable syntax
|
||||
|
||||
@@ -88,20 +114,3 @@ When you enable the **Multi-value** or **Include all value** options, Grafana co
|
||||
### Templated dashboard example
|
||||
|
||||
To view an example templated dashboard, refer to this [InfluxDB templated dashboard](https://play.grafana.org/d/f62a0410-5abb-4dd8-9dfc-caddfc3e2ffd/eccb2445-b0a2-5e83-8e0f-6d5ea53ad575).
|
||||
|
||||
{{% docs/reference %}}
|
||||
[add-template-variables-chained-variables]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#chained-variables"
|
||||
[add-template-variables-chained-variables]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#chained-variables"
|
||||
|
||||
[add-template-variables-add-ad-hoc-filters]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-ad-hoc-filters"
|
||||
[add-template-variables-add-ad-hoc-filters]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-ad-hoc-filters"
|
||||
|
||||
[add-template-variables-adds-a-query-variable]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-a-query-variable"
|
||||
[add-template-variables-adds-a-query-variable]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-a-query-variable"
|
||||
|
||||
[add-template-variables]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables"
|
||||
[add-template-variables]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables"
|
||||
|
||||
[variables]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables"
|
||||
[variables]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables"
|
||||
{{% /docs/reference %}}
|
||||
|
||||
Reference in New Issue
Block a user