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!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.