Documentation

Common variable queries

This page documents an earlier version of InfluxDB OSS. InfluxDB 3 Core is the latest stable version.

List buckets

List all buckets in the current organization.

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

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

List measurements

List all measurements in a specified bucket.

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

import "influxdata/influxdb/schema"

schema.measurements(bucket: "bucket-name")
  • Copy
  • Fill window

List fields in a measurement

List all fields in a specified bucket and measurement.

Flux package: InfluxDB schema
Flux functions: schema.measurementTagValues()

import "influxdata/influxdb/schema"

schema.measurementTagValues(
    bucket: "bucket-name",
    measurement: "measurement-name",
    tag: "_field",
)
  • Copy
  • Fill window

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 schema
Flux functions: schema.tagValues()

import "influxdata/influxdb/schema"

schema.tagValues(bucket: "bucket-name", tag: "host")
  • Copy
  • Fill window

List Docker containers

List all Docker containers when using the Docker Telegraf plugin.

Telegraf plugin: Docker
Flux package: InfluxDB schema
Flux functions: schema.tagValues()

import "influxdata/influxdb/schema"

schema.tagValues(bucket: "bucket-name", tag: "container_name")
  • Copy
  • Fill window

List Kubernetes pods

List all Kubernetes pods when using the Kubernetes Telegraf plugin.

Telegraf plugin: Kubernetes
Flux package: InfluxDB schema
Flux functions: schema.measurementTagValues()

import "influxdata/influxdb/schema"

schema.measurementTagValues(
    bucket: "bucket-name",
    measurement: "kubernetes_pod_container",
    tag: "pod_name",
)
  • Copy
  • Fill window

List Kubernetes nodes

List all Kubernetes nodes when using the Kubernetes Telegraf plugin.

Telegraf plugin: Kubernetes
Flux package: InfluxDB schema
Flux functions: schema.measurementTagValues()

import "influxdata/influxdb/schema"

schema.measurementTagValues(
    bucket: "bucket-name",
    measurement: "kubernetes_node",
    tag: "node_name",
)
  • Copy
  • Fill window

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

New in InfluxDB 3.2

Key enhancements in InfluxDB 3.2 and the InfluxDB 3 Explorer UI is now generally available.

See the Blog Post

InfluxDB 3.2 is now available for both Core and Enterprise, bringing the general availability of InfluxDB 3 Explorer, a new UI that simplifies how you query, explore, and visualize data. On top of that, InfluxDB 3.2 includes a wide range of performance improvements, feature updates, and bug fixes including automated data retention and more.

For more information, check out: