Delete on InfluxDB from CLI

Hi,
I am managing my InfluxDB Cloud buckets from CLI from my laptop.
I have followed the documentation but I am not able to delete entirely a measurement.

I have tried:

influx delete --org-id X --bucket-id Y --start 1970-01-01T00:00:00Z --stop $(date +“%Y-%m-%dT%H:%M:%SZ”) --predicate ‘_measurement=“Temperature”’

and many other small variants of this command but none of the actually deletes the Temperature measurement from my bucket. It is still there when I query from the InfluxDB Cloud Data Explorer.

Can anybody help?

Thanks

Hi,

You can use the CLI command as below:

Influx bucket delete --name second.

It will delete the bucket.

Hi,
I don’t want to delete the bucket, just one measurement inside the bucket.

Thanks
Alberto

I use CURL to delete, and I found kind of tricky to parse the predicate because there are quotes within quotes so I usually I scape one set and use Unicode to escape the other set.

curl "http://localhost:8086/api/v2/delete?org=ORGNAME&bucket=BUCKETNAME" ^
  -H "Authorization: Token HFSHDBGHSBDFKSBDKSDKVF34351358135154653" ^
  -H "Content-Type: application/json" ^
 --data "{\"start\": \"2023-09-07T20:27:00Z\",\"stop\": \"2023-09-07T20:28:00Z\", \"predicate\": \"THISISTHETAGNAME=\u0022THISISTHEVALUE\u0022\"}"

\u0022 is "

Hi, thanks, I’ll try.
My bucked is on InfluxDB Cloud. I guess the same approach would work by just changing the URL?