schema.measurementFieldKeys() function

The schema.measurementFieldKeys() function returns a list of fields in a measurement. The return value is always a single table with a single column, _value.

import "influxdata/influxdb/schema"

  bucket: "example-bucket",
  measurement: "example-measurement",
  start: -30d



Bucket to retrieve field keys from.

Data type: String


Measurement to list field keys from.

Data type: String


Oldest time to include in results. Defaults to -30d.

Relative start times are defined using negative durations. Negative durations are relative to now. Absolute start times are defined using time values.

Data type: Duration


import "influxdata/influxdb/schema"

  bucket: "telegraf",
  measurement: "cpu",

Function definition

package schema

measurementFieldKeys = (bucket, measurement, start=-30d) =>
  fieldKeys(bucket: bucket, predicate: (r) => r._measurement == measurement, start: start)

Used functions: schema.fieldKeys

Supported in the InfluxDB Cloud UI

The schema package can retrieve schema information from the InfluxDB Cloud user interface (UI), but not from the Flux REPL.

Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: