Can you delete data from influxdb?

spuder picture spuder · Oct 9, 2014 · Viewed 101.7k times · Source

How do you delete data from influxdb?

The documentation shows it should be as simple as:

delete from foo where time < now() -1h

For some reason, influxdb rejects my delete statements saying "Delete queries can't have where clause that doesn't reference time"

select * from bootstrap where duration > 1000 and time > 14041409940s and time < now()

I want to delete these 5 entries whos duration > 1000 seconds

enter image description here

This should be a valid sql statement, yet it fails

enter image description here

None of these delete statements work either

delete from bootstrap where duration > 3000000"

delete from bootstrap where duration > 300000"

delete from bootstrap where time = 1404140994043"

delete from bootstrap where duration > 300000 and time > 1404141054508 "

delete from bootstrap where duration > 300000 and time > 1404141054508s "

delete from bootstrap where time > 1404141054508s and duration > 300000 "

delete from bootstrap where duration > 30000 and time > 1s"

Documentation reference

http://influxdb.com/docs/v0.8/api/query_language.html

Update

Additional queries

delete from bootstrap where time > 1404141416824 and duration > 3000;
delete sequence_number from bootstrap where time > 1s and duration > 1000;

Maybe this is a bug?

https://github.com/influxdb/influxdb/issues/975
https://github.com/influxdb/influxdb/issues/84

Answer

John Clements picture John Clements · Sep 14, 2015

It appears that you can do this in influxdb 0.9. For instance, here's a query that just succeeded for me:

DROP SERIES FROM temperature WHERE machine='zagbar'

(Per generous comment by @MuratCorlu, I'm reposting my earlier comment as an answer...)