# Delete measurement in a bucket

**URL:** <https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996>\
**Category:** InfluxDB 2\
**Created:** [August 4, 2022, 6:16am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996 "2022-08-04T06:16:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felice\_Massaro](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/felice_massaro/32/6285_2.png) [@Felice\_Massaro](https://community.influxdata.com/u/Felice_Massaro)\
**Post date:** [August 4, 2022, 6:16am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/1 "2022-08-04T06:16:30Z")

</div>

I see this question has been posted in many different ways but I have not found any meeting my case.  
I simply need to remove/delete completely a measurement in a bucket.  
My bucket is “Donald”  
The measurement to remove/delete is “Duck”  
The measurement shall be completely removed from the bucket.  
I have not found any tool to do the above in the UI.

**In influx 1.x I simply use**

> Influx  
> use Donald  
> DROP MEASUREMENT Duck

How can I delete the measurement from the UI or using the CLI in Influx 2.3.x?

I would appreciate some help.

Thank you

---

<div class="post-metadata">

**Author:** ![Fang\_Renyang](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/fang_renyang/32/10589_2.png) [@Fang\_Renyang](https://community.influxdata.com/u/Fang_Renyang)\
**Post date:** [August 5, 2022, 7:24am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/2 "2022-08-05T07:24:09Z")

</div>

influx delete --bucket example-bucket --start 2020-03-01T00:00:00Z --stop 2022-11-14T00:00:00Z --predicate ‘\_measurement=“cpu”’

---

<div class="post-metadata">

**Author:** ![Felice\_Massaro](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/felice_massaro/32/6285_2.png) [@Felice\_Massaro](https://community.influxdata.com/u/Felice_Massaro)\
**Post date:** [August 6, 2022, 4:33am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/3 "2022-08-06T04:33:23Z")

</div>

Thank you for your reply.  
Could you kindly elaborate on why a start/stop date is required if the measurement is being completely deleted?  
Does your suggested query remove completely the “cpu” measurement or only the data within the specified start/stop date range?

Thank you for helping

---

<div class="post-metadata">

**Author:** ![Felice\_Massaro](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/felice_massaro/32/6285_2.png) [@Felice\_Massaro](https://community.influxdata.com/u/Felice_Massaro)\
**Post date:** [August 8, 2022, 9:24am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/4 "2022-08-08T09:24:44Z")

</div>

I did try but I am not coming right:

 ![Schermata 2022-08-08 alle 11.23.30](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/e/ec67e583491298123a0037aab059e4b470654916.png)

What I am trying to do is to completely delete the measurement shown in the picture “test”  
 ![Screenshot 2022-08-08 at 11.12.50](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/5/55068b48025a88d4e6e2d7daba037ced0db7d258.png)

---

<div class="post-metadata">

**Author:** ![Fang\_Renyang](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/fang_renyang/32/10589_2.png) [@Fang\_Renyang](https://community.influxdata.com/u/Fang_Renyang)\
**Post date:** [August 18, 2022, 6:33am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/5 "2022-08-18T06:33:52Z")

</div>

Hi Felice,

sorry for reply late.

 ![Screenshot from 2022-08-18 14-13-53](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/9/93f85fe521cd3205e2011f4fbe936f71cd038a37.png)

As you can see, I have a measurement, **test\_data** in **testing/autogen** bucket

from the command description, the start and stop should be optional, but when I tried to just type delete command without start and end, but it shows me an error  
Error: Request flags “start, stop” not set

 ![Screenshot from 2022-08-18 14-26-03](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/8/85e5205ee56a09595e3920b9d7e5da1b3006983b.png)

Therefore, I had to type start and stop flag  
as you can see, there is no error when I add start and end flag  
then, the test\_data measurement can be deleted successfully

 ![Screenshot from 2022-08-18 14-17-36](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/6/6f48e335b9fd409c2d486af93f6be9708a9309e7.png)

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [August 18, 2022, 4:18pm UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/6 "2022-08-18T16:18:08Z")

</div>

@Felice_Massaro Your `influxd delete` command didn’t work because you used curly quotes instead of straight quotes in the predicate and you didn’t close the outer single quote. You don’t need to include the start and stop flags. To fully remove a measurement, leave those out.

```nohighlight
influx delete --bucket datastorage --predicate '_measurement="test"'

```

---

<div class="post-metadata">

**Author:** ![yeboahnanaosei](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yeboahnanaosei/32/12514_2.png) [@yeboahnanaosei](https://community.influxdata.com/u/yeboahnanaosei)\
**Post date:** [January 28, 2023, 7:46am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/8 "2023-01-28T07:46:54Z")

</div>

@Scott Your suggestion does not seem to work.  
The command returns an error saying the “start” and “stop” flags are required.  
Here is the error I am getting: [Error: Required flags “start, stop” not set]  
Here is the command I typed: [influx delete --bucket rts --predicate ‘\_\_measurement=“stat”’]  
My influx CLI version: [Influx CLI 2.6.1 (git: 61c5b4d533) build\_date: 2022-12-29T12:58:32Z]

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [February 1, 2023, 5:19pm UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/9 "2023-02-01T17:19:45Z")

</div>

@yeboahnanaosei In the command that you provided, you have two underscores in front of `measurement`. You should only have one: `_measurement`.

---

<div class="post-metadata">

**Author:** ![yeboahnanaosei](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yeboahnanaosei/32/12514_2.png) [@yeboahnanaosei](https://community.influxdata.com/u/yeboahnanaosei)\
**Post date:** [February 1, 2023, 5:51pm UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/10 "2023-02-01T17:51:58Z")

</div>

@scott Thank you for that. I am actually surprised how the two underscores ended up there. I have taken a screen recording and I will share that soon. The command still requires you to specify the start and stop dates.

Here is a link to the screen recording: [screen\_recording.mp4 - Google Drive](https://drive.google.com/file/d/14jgg5vh1QW2xGNIbrnL8Bd7D9cgLolo8/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![yeboahnanaosei](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yeboahnanaosei/32/12514_2.png) [@yeboahnanaosei](https://community.influxdata.com/u/yeboahnanaosei)\
**Post date:** [February 15, 2023, 2:21am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/11 "2023-02-15T02:21:44Z")

</div>

Hi @scott, kindly, have you seen the video?

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [February 15, 2023, 4:40pm UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/12 "2023-02-15T16:40:17Z")

</div>

You can just include the start and stop times with the command:

```bash
influx delete \
  --bucket rts \
  --predicate '_measurement="stat"' \
  --start 1970-01-01T00:00:00Z \
  --stop 2023-02-16T00:00:00Z

```

---

<div class="post-metadata">

**Author:** ![Ibrahim\_Abubkr](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/ibrahim_abubkr/32/16918_2.png) [@Ibrahim\_Abubkr](https://community.influxdata.com/u/Ibrahim_Abubkr)\
**Post date:** [November 26, 2024, 4:54am UTC](https://community.influxdata.com/t/delete-measurement-in-a-bucket/25996/13 "2024-11-26T04:54:55Z")

</div>

hi,  
you probably solved this but all of you options didn’t work with me so i just want to add what worked for me  
i took a screen shot because the editor here removes it

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/3X/f/4/f4fdadc3a2fcb1423f0384e4bf17a6018b72d641.png)

i am using windows and run this on cmd not PowerShell
