I want to print the result of device_temperature, device_humidity together
An API which can print both result together in json .
from(bucket: “general”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “mem”)
|> filter(fn: (r) => r[“_field”] == “device_humidity” or r[“_field”] == “device_temperature”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)
I am able to get one item at a time , any better way to do this.
from(bucket: “general”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “mem”)
|> filter(fn: (r) => r[“_field”] == “device_humidity” )
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)
from(bucket: “general”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “mem”)
|> filter(fn: (r) => r[“_field”] == “device_temperature”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)
Where I am able to get the data all together , like a table with both device_mac,time,humidity,temperature etc