---
title: Common variable queries
description: Useful queries to use to populate values in common dashboard variable use cases.
menu:
  v2_0:
    parent: Use and manage variables
    name: Common variable queries
weight: 208
"v2.0/tags": [variables]
---

## List buckets
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
buckets()
  |> rename(columns: {"name": "_value"})
  |> keep(columns: ["_value"])
```

## List measurements
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
import "influxdata/influxdb/v1"
v1.measurements(bucket: "bucket-name")
```

## List fields in a 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
import "influxdata/influxdb/v1"
v1.measurementTagValues(
  bucket: "bucket-name",
  measurement: "measurment-name",
  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"
)
```
