Archived documentation version rendered and hosted by DevNetExpertTraining.com
Documentation

Common variable queries

List buckets

List all buckets in the current organization.

Flux functions: buckets(), rename(), keep()

buckets()
    |> rename(columns: {"name": "_value"})
    |> keep(columns: ["_value"])

List measurements

List all measurements in a specified bucket.

Flux package: InfluxDB v1
Flux functions: v1.measurements()

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
Flux functions: v1.measurementTagValues()

import "influxdata/influxdb/v1"

v1.measurementTagValues(
    bucket: "bucket-name",
    measurement: "measurment-name",
    tag: "_field",
)

List unique tag values

List all unique tag values for a specific tag in a specified bucket. The example below lists all unique values of the host tag.

Flux package: InfluxDB v1
Flux functions: v1.tagValues()

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
Flux package: InfluxDB v1
Flux functions: v1.tagValues()

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
Flux package: InfluxDB v1
Flux functions: v1.measurementTagValues()

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
Flux package: InfluxDB v1
Flux functions: v1.measurementTagValues()

import "influxdata/influxdb/v1"

v1.measurementTagValues(
    bucket: "bucket-name",
    measurement: "kubernetes_node",
    tag: "node_name",
)

Select your region

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.