schema.fieldKeys() function

The schema.fieldKeys() function returns field keys in a bucket. The return value is always a single table with a single column, _value.

import "influxdata/influxdb/schema"

  bucket: "example-bucket",
  predicate: (r) => true,
  start: -30d



The bucket to list field keys from.


The predicate function that filters field keys. Default is (r) => true.


The oldest time to include in results. Default is -30d.

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


import "influxdata/influxdb/schema"

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

Function definition

package schema

fieldKeys = (bucket, predicate=(r) => true, start=-30d) =>
  tagValues(bucket: bucket, tag: "_field", predicate: predicate, start: start)

Used functions: schema.tagValues

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.

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.