flux 使用方法
InfluxQL
SHOW TAG VALUES WITH KEY = "host"
Flux
from(bucket: "geth")
|> range(start: v.timeRangeStart)
|> keyValues(keyColumns: ["host"])
|> keep(columns: ["host"])
|> distinct(column: "host")
|> group()
from(bucket: "geth")
|> range(start: -30m)
|> filter(fn: (r) => r["_measurement"] == "geth.chain/head/block.gauge" and r["host"] == "${host}" )
|> last()
参考文档
https://docs.influxdata.com/flux/v0.x/stdlib/
https://docs.influxdata.com/influxdb/v1.8/query_language/functions/