# Bug? when trying to delete a range from decisions

**URL:** https://discourse.crowdsec.net/t/bug-when-trying-to-delete-a-range-from-decisions/727
**Category:** Uncategorized
**Created:** [April 12, 2022, 1:28pm UTC](https://discourse.crowdsec.net/t/bug-when-trying-to-delete-a-range-from-decisions/727 "2022-04-12T13:28:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Foxinou35](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/foxinou35/32/147_2.png) [@Foxinou35](https://discourse.crowdsec.net/u/Foxinou35)
#### Post date: [April 12, 2022, 1:28pm UTC](https://discourse.crowdsec.net/t/bug-when-trying-to-delete-a-range-from-decisions/727/1 "2022-04-12T13:28:16Z")

</div>

Hi 🙂  
Have a look :

```auto
root@myserver-008:/var/log/nginx# cscli decisions list -l0|grep 163.116.163
| 6312485 | crowdsec | Ip:163.116.163.113 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m42.078921s | 168982 |
| 6312484 | crowdsec | Ip:163.116.163.141 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m41.478303875s | 168981 |
| 6312483 | crowdsec | Ip:163.116.163.121 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m36.395457105s | 168980 |
| 6312479 | crowdsec | Ip:163.116.163.120 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m28.486711655s | 168976 |
| 6312478 | crowdsec | Ip:163.116.163.123 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m27.748867461s | 168975 |
| 6312477 | crowdsec | Ip:163.116.163.117 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m27.165810604s | 168974 |
| 6312476 | crowdsec | Ip:163.116.163.115 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m26.955817421s | 168973 |
| 6312475 | crowdsec | Ip:163.116.163.118 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m26.812355654s | 168972 |
| 6312473 | crowdsec | Ip:163.116.163.140 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m25.509125098s | 168970 |
| 6312472 | crowdsec | Ip:163.116.163.116 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m24.806342948s | 168969 |
| 6312471 | crowdsec | Ip:163.116.163.139 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m24.184873843s | 168968 |
| 6312470 | crowdsec | Ip:163.116.163.142 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m24.155431617s | 168967 |
| 6312469 | crowdsec | Ip:163.116.163.124 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m21.939050027s | 168966 |
| 6312468 | crowdsec | Ip:163.116.163.122 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m20.305851825s | 168965 |
| 6312467 | crowdsec | Ip:163.116.163.114 | crowdsecurity/http-bad-user-agent | ban | FR | 0 | 2 | 55m18.993079451s | 168964 |
root@myserver-008:/var/log/nginx# cscli decisions delete -r 163.116.163.0/24
INFO[12-04-2022 11:41:33 AM] 0 decision(s) deleted                        
root@myserver-008:/var/log/nginx# 

```

Seems clearly a bug. If I try to delete the Ip one by one, it works

```auto
root@myserver-008:/var/log/nginx# cscli decisions delete -i 163.116.163.114
INFO[12-04-2022 11:44:15 AM] 1 decision(s) deleted                        
root@myserver-008:/var/log/nginx#

```

Crowdsec 1.3.0 on Ubuntu

Thanks

---

<div class="post-metadata">

### Author: ![alteredCoder](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/alteredcoder/32/44_2.png) [@alteredCoder](https://discourse.crowdsec.net/u/alteredCoder)
#### Post date: [April 13, 2022, 9:08am UTC](https://discourse.crowdsec.net/t/bug-when-trying-to-delete-a-range-from-decisions/727/2 "2022-04-13T09:08:55Z")

</div>

Hello,

To delete decisions from range, you must use the `--contained` flag.  
For your case, `cscli decisions delete -r 163.116.163.0/24 --contained` should works.

---

<div class="post-metadata">

### Author: ![Foxinou35](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/foxinou35/32/147_2.png) [@Foxinou35](https://discourse.crowdsec.net/u/Foxinou35)
#### Post date: [April 13, 2022, 10:23am UTC](https://discourse.crowdsec.net/t/bug-when-trying-to-delete-a-range-from-decisions/727/3 "2022-04-13T10:23:57Z")

</div>

Hi !  
Yes it should work, but I don’t understand the --contained flag.

As a “simple user”, I just would like to delete the decisions on a range, why should I have to specify this ?

---

<div class="post-metadata">

### Author: ![alteredCoder](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/alteredcoder/32/44_2.png) [@alteredCoder](https://discourse.crowdsec.net/u/alteredCoder)
#### Post date: [April 13, 2022, 1:43pm UTC](https://discourse.crowdsec.net/t/bug-when-trying-to-delete-a-range-from-decisions/727/4 "2022-04-13T13:43:40Z")

</div>

Hello,

Indeed, this is not very user friendly. We are going to invert this behavior in the next release.
