v1.tagValues() function

v1.tagValues() was deprecated in Flux v0.88.0 in favor of schema.tagValues().

The v1.tagValues() function returns a list of unique values for a given tag. The return value is always a single table with a single column, _value.

import "influxdata/influxdb/v1"

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



Bucket to return unique tag values from.

Data type: String


Tag to return unique values from.

Data type: String


Predicate function that filters tag values. Defaults to (r) => true.

Data type: Function


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/v1"

  bucket: "my-bucket",
  tag: "host",

Function definition

package v1

tagValues = (bucket, tag, predicate=(r) => true, start=-30d) =>
  from(bucket: bucket)
    |> range(start: start)
    |> filter(fn: predicate)
    |> group(columns: [tag])
    |> distinct(column: tag)
    |> keep(columns: ["_value"])

Used functions: from, range, filter, group, distinct, keep

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: