I simply want to create a variable of all possible values of a tag within a measurement. In influx v2 its a mystery

I simply want to create a variable of all possible values of a tag within a measurement. In influx v2 its a mystery. I’ve scoured the v2 docs and its not obvious how to do this. I found this: Common variable queries | InfluxDB OSS 2.0 Documentation. It says to query this:

import "influxdata/influxdb/v1"
v1.tagValues(bucket: "bucket-name", tag: "host")

But, what the heck is that? I tried using it, changing out the values for my circumstance but just kept getting errors in the script editor.

I’m using cloud2.influxdata.com.

@risingtiger What errors are you getting in the script editor? Are you trying to create a dashboard variable or a Flux variable?

I think it’s a dashboard variable. So that I’ll be able to filter the graph based upon a specific tag.

@risingtiger What errors do you get in the script editor when you run that query?

I feel a bit foolish. I went back to find out what the error was again and its working this time.

Out of curiosity on this line: "import “influxdata/influxdb/v1”. shouldn’t that be v2 because I’m using v2 of influxdb, or is that something different?

That line imports a package of functions designed to work with metadata similar to how you would in InfluxDB v1. That’s why it’s in the influxdata/influxdb/v1 package. Sorry for the confusion.