Aim: to create a variable (drop down list) of each containers host name form the host file in the data of the containers bucket similar to how this bit of code works for the buckets.
Using code below I get a list of buckets that I can use in the dashboards
buckets()
|> filter(fn: (r) => r.name !~ /^_/)
|> rename(columns: {name: "_value"})
|> keep(columns: ["_value"])
This is my code that produces the right type of results when exploring the data as a table, although i am confused by the group by and unique as they don’t do what I would expect them to. Also the variable is never populated. when used in a dashboard the value is always ‘No Value’
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> keep(columns: ["host"])
|> group(columns: ["host"])
|> unique(column: "host")
|> rename(columns: {"host": "_value"})