Hi,

I would like to get a list of series which don't have any recent data. The goal 
is to periodically delete such series (note: this is very different from 
retention policy).

The naive query would be..

SELECT last(time) FROM cpu WHERE last(time) < now() - 1d GROUP BY *

Unfortunately, you cannot select last(time), but you can do last(<somefield>).

SELECT last(usage_user) FROM cpu WHERE last(time) < now() - 1d GROUP BY *

That does not work either, becuase "last(time)" is not a valid expression for 
the timestamp-of-last-datapoint.

ERR: invalid expression: last(time) > '2016-06-28T11:20:04.209687973Z'

Right now, the only solution that comes to my mind is to do the opposite. Find 
all series _with_ recent data. And then subtract it from the whole set.

# series with the recent data
SELECT last(usage_user) FROM cpu WHERE time > now() - 1d GROUP BY *

I would have to parse output of that select, match it with output of SHOW 
SERIES and then convert to list of DROP SERIES. The whole task will turn into 
quite complex awk mess very soon.

Before doings so, I would like to ask if there isn't a more elegant way.

Thanks,

Brano Zarnovican

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/f48a8fee-c67a-4042-8561-1fdb0160d9d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to