Just new to InfluxDB.
I have a monitored IO signal that everytime it is changed then InfluxDB will record its timestamp. The data is like below:
time value
---- -----
2020-03-19 06:02:50 0
2020-03-19 06:01:28 1.00
2020-03-19 03:25:58 0
2020-03-19 03:22:38 1.00
2020-03-18 23:07:47 0
2020-03-18 23:06:47 1.00
2020-03-18 21:14:47 0
2020-03-18 21:12:45 1.00
2020-03-18 21:11:23 0
2020-03-18 21:09:41 1.00
2020-03-18 21:07:30 0
...
Now I want to get the elapsed time for value = 1 ONLY (which means the elapsed time that the switch is on)
Firstly I tried SELECT elapsed("value")/3600/1000000000 FROM "MyMeasurement"
then I got a series like this:
time elapsed
---- -----
2020-03-19 06:02:50 0.02
2020-03-19 06:01:28 2.59
2020-03-19 03:25:58 0.06
2020-03-19 03:22:38 4.25
2020-03-18 23:07:47 0.02
2020-03-18 23:06:47 1.87
2020-03-18 21:14:47 0.03
2020-03-18 21:12:45 0.02
2020-03-18 21:11:23 0.03
2020-03-18 21:09:41 0.04
2020-03-18 21:07:30 0.02
...
how can I narrow down the series to those I concern [0.02, 0.06, 0.02, 0.03, 0.03, 0.02 ...]? I have to do this in InfluxDB query command since I'm popping this onto Grafana panel. Can anyone help me on this please?