I know DROP MEASUREMENT measurement_name
used to drop single measurement. How to delete all measurements at once ?
Asked
Active
Viewed 8.9k times
44

rajagopalx
- 3,012
- 9
- 41
- 52
-
1for future myself: https://docs.influxdata.com/influxdb/v1.3/query_language/database_management/#drop-series-from-the-index-with-drop-series – kmonsoor Jul 31 '17 at 16:09
5 Answers
91
Theres no way to drop all of the measurements directly, but the query below will achieve the same result.
DROP SERIES FROM /.*/

Michael Desa
- 4,607
- 24
- 19
-
2This worked for me, but I wanted to only delete one measurement not all, how do I choose to delete all data within a single measurement? – valentt Nov 26 '19 at 21:16
6
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: ...

kmonsoor
- 7,600
- 7
- 41
- 55
0
clear bucket in command line: influx delete --bucket 'mybucket' --org 'myorg' --start 1970-01-01T00:00:00Z --stop $(date +"%Y-%m-%dT%H:%M:%SZ")