Explore your data schema with Flux

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.

  1. buckets()

List measurements

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

  1. import "influxdata/influxdb/schema"
  2. schema.measurements(bucket: "example-bucket")

List field keys

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

  1. import "influxdata/influxdb/schema"
  2. schema.fieldKeys(bucket: "example-bucket")

List fields in a measurement

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

  1. import "influxdata/influxdb/schema"
  2. schema.measurementFieldKeys(
  3. bucket: "example-bucket",
  4. measurement: "example-measurement"
  5. )

List tag keys

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

  1. import "influxdata/influxdb/schema"
  2. 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.

  1. import "influxdata/influxdb/schema"
  2. schema.measurementTagKeys(
  3. bucket: "example-bucket",
  4. measurement: "example-measurement"
  5. )

List tag values

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

  1. import "influxdata/influxdb/schema"
  2. 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.

  1. import "influxdata/influxdb/schema"
  2. schema.measurementTagValues(
  3. bucket: "example-bucket",
  4. tag: "example-tag",
  5. measurement: "example-measurement"
  6. )

Related articles

schema