Documentation

Explore your data schema with Flux

This page documents an earlier version of InfluxDB. InfluxDB v2.7 is the latest stable version. View this page in the v2.7 documentation.

Flux provides functions that let you explore the structure and schema of your data stored in InfluxDB.

List buckets

Use the buckets() function to list buckets in your organization.

buckets()

List measurements

Use the schema.measurements() function to list measurements in a bucket.

import "influxdata/influxdb/schema"

schema.measurements(bucket: "example-bucket")

List field keys

Use the schema.fieldKeys function to list field keys in a bucket.

import "influxdata/influxdb/schema"

schema.fieldKeys(bucket: "example-bucket")

List fields in a measurement

Use the schema.measurementFieldKeys function to list field keys in a measurement.

import "influxdata/influxdb/schema"

schema.measurementFieldKeys(
  bucket: "example-bucket",
  measurement: "example-measurement"
)

List tag keys

Use the schema.tagKeys() function to list tag keys in a bucket.

import "influxdata/influxdb/schema"

schema.tagKeys(bucket: "example-bucket")

List tag keys in a measurement

Use the schema.measurementTagKeys function to list tag keys in a measurement. This function returns results from the last 30 days.

import "influxdata/influxdb/schema"

schema.measurementTagKeys(
  bucket: "example-bucket",
  measurement: "example-measurement"
)

List tag values

Use the schema.tagValues() function to list tag values for a given tag in a bucket.

import "influxdata/influxdb/schema"

schema.tagValues(bucket: "example-bucket", tag: "example-tag")

List tag values in a measurement

Use the schema.measurementTagValues function to list tag values for a given tag in a measurement. This function returns results from the last 30 days.

import "influxdata/influxdb/schema"

schema.measurementTagValues(
  bucket: "example-bucket",
  tag: "example-tag",
  measurement: "example-measurement"
)

Was this page helpful?

Thank you for your feedback!


Set your InfluxDB URL

Introducing InfluxDB 3.0

The new core of InfluxDB built with Rust and Apache Arrow. Available today in InfluxDB Cloud Dedicated.

Learn more

State of the InfluxDB Cloud Serverless documentation

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.