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/

 

posted @ 2023-04-24 21:03  小吉猫  阅读(88)  评论(0编辑  收藏  举报