commit
79238a541f
|
@ -11,13 +11,13 @@ weight: 101
|
||||||
"v2.0/tags": [variables]
|
"v2.0/tags": [variables]
|
||||||
---
|
---
|
||||||
|
|
||||||
Dashboard variables allow you to alter specific components of cells' queries
|
Dashboard variables let you alter specific components of cells' queries without having to edit the queries,
|
||||||
without having to edit the queries, making it easy to interact with your dashboard cells and explore your data.
|
making it easy to interact with your dashboard cells and explore your data.
|
||||||
|
|
||||||
Variables are scoped by organization.
|
Variables are scoped by organization.
|
||||||
|
|
||||||
## Use dashboard variables
|
## Use dashboard variables
|
||||||
Both [custom dashboard variables](#manage-custom-variables) and [predefined dashboard variables](#predefined-dashboard-variables)
|
Both [predefined dashboard variables](#predefined-dashboard-variables) and [custom dashboard variables](#manage-custom-variables)
|
||||||
are stored in a `v` object associated with each dashboard.
|
are stored in a `v` object associated with each dashboard.
|
||||||
Reference each variable using dot-notation (e.g. `v.variableName`).
|
Reference each variable using dot-notation (e.g. `v.variableName`).
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ in the **Variables** tab next to the Functions tab.
|
||||||
Click on a variable name to add it to your query and select a value from the **Value** dropdown.
|
Click on a variable name to add it to your query and select a value from the **Value** dropdown.
|
||||||
|
|
||||||
## Predefined dashboard variables
|
## Predefined dashboard variables
|
||||||
The InfluxDB provides the following predefined dashboard variables:
|
The InfluxDB user interface (UI) provides the following predefined dashboard variables:
|
||||||
|
|
||||||
#### v.timeRangeStart
|
#### v.timeRangeStart
|
||||||
Specifies the beginning of the queried time range.
|
Specifies the beginning of the queried time range.
|
||||||
|
@ -55,7 +55,7 @@ It defaults to `now`.
|
||||||
|
|
||||||
#### v.windowPeriod
|
#### v.windowPeriod
|
||||||
Specifies the period of windowed data.
|
Specifies the period of windowed data.
|
||||||
This variable is typically used to define the `every` or `period` parameter of the
|
This variable is typically used to define the `every` or `period` parameters of the
|
||||||
[`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window)
|
[`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window)
|
||||||
in data aggregation operations.
|
in data aggregation operations.
|
||||||
|
|
||||||
|
|
|
@ -9,33 +9,37 @@ weight: 208
|
||||||
"v2.0/tags": [variables]
|
"v2.0/tags": [variables]
|
||||||
---
|
---
|
||||||
|
|
||||||
### List buckets
|
## List buckets
|
||||||
List all buckets in the current organization.
|
List all buckets in the current organization.
|
||||||
|
|
||||||
|
_**Flux functions:**
|
||||||
|
[buckets()](/v2.0/reference/flux/functions/built-in/inputs/buckets/),
|
||||||
|
[rename()](/v2.0/reference/flux/functions/built-in/transformations/rename/),
|
||||||
|
[keep()](/v2.0/reference/flux/functions/built-in/transformations/keep/)_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
buckets()
|
buckets()
|
||||||
|> rename(columns: {"name": "_value"})
|
|> rename(columns: {"name": "_value"})
|
||||||
|> keep(columns: ["_value"])
|
|> keep(columns: ["_value"])
|
||||||
```
|
```
|
||||||
|
|
||||||
### List measurements
|
## List measurements
|
||||||
List all measurements in a specified bucket.
|
List all measurements in a specified bucket.
|
||||||
|
|
||||||
|
_**Flux package:** [InfluxDB v1](/v2.0/reference/flux/functions/influxdb-v1/)
|
||||||
|
**Flux functions:** [v1.measurements()](/v2.0/reference/flux/functions/influxdb-v1/measurements/)_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import "influxdata/influxdb/v1"
|
import "influxdata/influxdb/v1"
|
||||||
v1.measurements(bucket: "bucket-name")
|
v1.measurements(bucket: "bucket-name")
|
||||||
```
|
```
|
||||||
|
|
||||||
### List hosts
|
## List fields in a measurement
|
||||||
List all `host` tag values in a specified bucket.
|
|
||||||
|
|
||||||
```js
|
|
||||||
import "influxdata/influxdb/v1"
|
|
||||||
v1.tagValues(bucket: "bucket-name", tag: "host")
|
|
||||||
```
|
|
||||||
|
|
||||||
### List fields in a measurement
|
|
||||||
List all fields in a specified bucket and measurement.
|
List all fields in a specified bucket and measurement.
|
||||||
|
|
||||||
|
_**Flux package:** [InfluxDB v1](/v2.0/reference/flux/functions/influxdb-v1/)
|
||||||
|
**Flux functions:** [v1.measurementTagValues()](/v2.0/reference/flux/functions/influxdb-v1/measurementtagvalues/)_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import "influxdata/influxdb/v1"
|
import "influxdata/influxdb/v1"
|
||||||
v1.measurementTagValues(
|
v1.measurementTagValues(
|
||||||
|
@ -44,3 +48,58 @@ v1.measurementTagValues(
|
||||||
tag: "_field"
|
tag: "_field"
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## List hosts
|
||||||
|
List all `host` tag values in a specified bucket.
|
||||||
|
|
||||||
|
_**Flux package:** [InfluxDB v1](/v2.0/reference/flux/functions/influxdb-v1/)_
|
||||||
|
_**Flux functions:** [v1.measurements()](/v2.0/reference/flux/functions/influxdb-v1/measurements/)_
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "influxdata/influxdb/v1"
|
||||||
|
v1.tagValues(bucket: "bucket-name", tag: "host")
|
||||||
|
```
|
||||||
|
|
||||||
|
## List Docker containers
|
||||||
|
List all Docker containers when using the Docker Telegraf plugin.
|
||||||
|
|
||||||
|
_**Telegraf plugin:** [Docker](https://docs.influxdata.com/telegraf/latest/plugins/inputs/#docker)_
|
||||||
|
_**Flux package:** [InfluxDB v1](/v2.0/reference/flux/functions/influxdb-v1/)_
|
||||||
|
_**Flux functions:** [v1.tagValues()](/v2.0/reference/flux/functions/influxdb-v1/tagvalues/)_
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "influxdata/influxdb/v1"
|
||||||
|
v1.tagValues(bucket: "bucket-name", tag: "container_name")
|
||||||
|
```
|
||||||
|
|
||||||
|
## List Kubernetes pods
|
||||||
|
List all Kubernetes pods when using the Kubernetes Telegraf plugin.
|
||||||
|
|
||||||
|
_**Telegraf plugin:** [Kubernetes](https://docs.influxdata.com/telegraf/latest/plugins/inputs/#kubernetes)_
|
||||||
|
_**Flux package:** [InfluxDB v1](/v2.0/reference/flux/functions/influxdb-v1/)_
|
||||||
|
_**Flux functions:** [v1.measurementTagValues()](/v2.0/reference/flux/functions/influxdb-v1/measurementtagvalues/)_
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "influxdata/influxdb/v1"
|
||||||
|
v1.measurementTagValues(
|
||||||
|
bucket: "bucket-name",
|
||||||
|
measurement: "kubernetes_pod_container",
|
||||||
|
tag: "pod_name"
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
## List Kubernetes nodes
|
||||||
|
List all Kubernetes nodes when using the Kubernetes Telegraf plugin.
|
||||||
|
|
||||||
|
_**Telegraf plugin:** [Kubernetes](https://docs.influxdata.com/telegraf/latest/plugins/inputs/#kubernetes)_
|
||||||
|
_**Flux package:** [InfluxDB v1](/v2.0/reference/flux/functions/influxdb-v1/)_
|
||||||
|
_**Flux functions:** [v1.measurementTagValues()](/v2.0/reference/flux/functions/influxdb-v1/measurementtagvalues/)_
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "influxdata/influxdb/v1"
|
||||||
|
v1.measurementTagValues(
|
||||||
|
bucket: "bucket-name",
|
||||||
|
measurement: "kubernetes_node",
|
||||||
|
tag: "node_name"
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -13,11 +13,10 @@ weight: 207
|
||||||
In the current version of InfluxDB v2.0 alpha, only [query-populated variables](#query) are available.
|
In the current version of InfluxDB v2.0 alpha, only [query-populated variables](#query) are available.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
Variable types determine how the list of possible values is populated.
|
Variable types determine how a variable's list of possible values is populated.
|
||||||
|
|
||||||
## Query
|
## Query
|
||||||
Variable values are populated using the results of a Flux query.
|
Variable values are populated using the `_value` column of a Flux query.
|
||||||
All values in the `_value` column are possible values for the variable.
|
|
||||||
|
|
||||||
##### Variable query example
|
##### Variable query example
|
||||||
```js
|
```js
|
||||||
|
|
Loading…
Reference in New Issue