Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Influxdb, How to delete all measurements?

Tags:

influxdb

I know DROP MEASUREMENT measurement_name used to drop single measurement. How to delete all measurements at once ?

like image 728
rajagopalx Avatar asked Jul 26 '16 10:07

rajagopalx


People also ask

How do I delete measurements in InfluxDB?

Delete measurements with DROP MEASUREMENT The DROP MEASUREMENT query deletes all data and series from the specified measurement and deletes the measurement from the index. Note: DROP MEASUREMENT drops all data and series in the measurement. It does not drop the associated continuous queries.

How do I delete an InfluxDB bucket?

Delete a bucket in the InfluxDB UIIn the navigation menu on the left, select Load Data > Buckets. Find the bucket that you would like to delete. Click the icon located far right of the bucket name. Click Confirm to delete the bucket.

What is downsampling in InfluxDB?

Downsampling allows you to reduce the overall disk usage as you collect data over time. Downsampling can also improve query performance for InfluxDB OSS or Cloud. Finally, InfluxDB can ingest hundreds of thousands of points per second.


2 Answers

Theres no way to drop all of the measurements directly, but the query below will achieve the same result.

DROP SERIES FROM /.*/ 
like image 184
Michael Desa Avatar answered Sep 22 '22 17:09

Michael Desa


For those who are looking to use WHERE clause with DROP SERIES, here it is:

DROP SERIES FROM /.*/ WHERE "your-tag" = 'tag-value-to-delete-data'

Please notice the quotation marks on after the WHERE clause, they should be like this for DROP SERIES; as of InfluxDB v.1.3.

Else, you might get error like ERR: invalid expression: ...

like image 38
kmonsoor Avatar answered Sep 23 '22 17:09

kmonsoor