schema.tagKeys() function
The schema.tagKeys()
function returns a list of tag keys for all series that match the predicate
.
The return value is always a single table with a single column, _value
.
import "influxdata/influxdb/schema"
schema.tagKeys(
bucket: "example-bucket",
predicate: (r) => true,
start: -30d
)
Parameters
bucket
Bucket to return tag keys from.
Data type: String
predicate
Predicate function that filters tag keys.
Defaults to (r) => true
.
Data type: Function
start
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
Examples
import "influxdata/influxdb/schema"
schema.tagKeys(bucket: "my-bucket")
Function definition
package schema
tagKeys = (bucket, predicate=(r) => true, start=-30d) =>
from(bucket: bucket)
|> range(start: start)
|> filter(fn: predicate)
|> keys()
|> keep(columns: ["_value"])
|> distinct()
Used functions: from, range, filter, keys, keep, distinct
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, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.