How to find out all series without data last 24 hours

I have no idea what is a good way to find out all series without data last 24 hours and drop them.
Any good ideas?
Thanks

1 Like

+1 I’d really love to get an answer on that too. I have a huge time series with lots of gaps and would like to detect them somehow.

Kapacitor has a deadman feature which can alert you if data stops being received. Its a realtime operation so it can’t be used to historically inspect a series for gaps.

The Elapsed function could be used to check for large gaps in data. A simple Kapacitor TICKscript to compute the elapsed time between points and then alert on values greater than 24h could work. And in that case you could rerun the TICKscript for historical data.

1 Like

I mean that the series will never have data forever.
For example, show all series with the condition “last value’s timestamp < 2017-06-09T00:00:00Z”.
It means these series will have no data forever in my system, I want to drop them with “DROP SERIES”.

Can’t you do just that though? If a query like

select last(value) from measurement where time > now() - 24h group by time(10s)

comes back empty, just drop that measurement? To @nathaniel’s point, if you want to do this on a LIVE STREAM you can use kapacitor to set that up, but for anything that’s already committed to the database you can just do this manually.

Alternatively, you can design something programmatic using influxdb-python that queries for the above, sending a drop measurement command if the returned query is nil. Throw that into a cron job of some kind and you’re done! Kinda hacky, but at least it could be automated.