Convert query to FLUX

Started my migration to 2.2 from 1.x and having trouble with a dashboard variable query that I use quite a bit to filter. I have searched and read a lot of articles but can’t seem to find how to put tag Values with a WHERE clause

SHOW TAG VALUES FROM "disk" WITH KEY = "path" WHERE host =~ /$server/
SHOW TAG VALUES FROM "cpu" WITH KEY = "cpu" WHERE host =~ /$server/

I use these quite a bit to filter disks, paths, interfaces etc in my dashboards. I have converted many that don’t have a WHERE clause with this:

import "influxdata/influxdb/schema"

schema.tagValues(bucket: v.bucket , tag: "host")

Hello @RonV42.
Welcome!
you can use the filter function instead of a where clause:

This might also be helpful:

1 Like

Thanks I will give the filter function a shot.

1 Like