[Solved]How to find gaps in my data?

time
influxdb
#1

I’m looking for a query that will return to me all of the times where i’m missing data for over than 30 minutes (because of some bug or disconnection).

Lets say I have this data:

time [other data (irrelevant)…]

2017-11-01T20:00:00.000000000Z
2017-11-01T20:01:00.000000000Z
2017-11-01T20:02:00.000000000Z
2017-11-01T20:03:00.000000000Z
2017-11-01T20:50:00.000000000Z
2017-11-01T20:51:00.000000000Z

I would like the query to return:

time


2017-11-01T20:03:00.000000000Z

How can I write that query?
Thanks in advance.

#2

I found the answer I was looking for:

select * from (SELECT max(“money”) FROM table WHERE time > ‘2017-07-30T21:00:00Z’ GROUP BY time(2m) fill(-10000)) where max = -10000;

Couldn’t query with nulls so I just inserted some values of -10000 to the nules, there might be a better solution but this one works for me.

1 Like