yusu
1
is it possible to get unixtime on message?
yusu
2
I managed by following method with flux.
I added following line inside query.
|> set(key: "atime", value: strings.substring(v: string(v: uint(v: now())), start: 0, end: 13))
Query will be…
import "strings"
from(bucket: v.defaultBucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "data")
|> set(key: "atime", value: strings.substring(v: string(v: uint(v: now())), start: 0, end: 13))
|> filter(fn: (r) => r["_field"] == "state" or r["_field"] == "atime")
|> aggregateWindow(every: 1m, fn: last, createEmpty: false)
|> group(columns: ["jigloc","SN","atime"])
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
Updated image 2023/01/28
1 Like
Thank you for sharing solution with us! It will be of great help for me since I wanted to do the same.
Best regards,
ldrascic
1 Like