44

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

rajagopalx
  • 3,012
  • 9
  • 41
  • 52
  • 1
    for 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 Answers5

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
  • 2
    This 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
1

The way to delete all entries of one MEASUREMENT is

DELETE FROM MEASUREMENT_NAME

angie866
  • 77
  • 6
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")

-2

use "DELETE Measurement" from InfluxDB admin Panel