# ElasticSearch: how to delete index containing %-character?

**URL:** <https://discuss.elastic.co/t/elasticsearch-how-to-delete-index-containing-character/27647>\
**Category:** Elasticsearch\
**Created:** [August 19, 2015, 8:14am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-delete-index-containing-character/27647 "2015-08-19T08:14:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartinG](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MartinG](https://discuss.elastic.co/u/MartinG)\
**Post date:** [August 19, 2015, 8:14am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-delete-index-containing-character/27647/1 "2015-08-19T08:14:41Z")

</div>

Hello,

I accidently created an index containing a %-character and I am not able to delete it. I tried several ways to escape without success.

Index name: index-%{env}-2015-08-19

I tried the following:  
curl -XDELETE [http://localhost:9200/miplog-%%{env}-2015.08.19](http://localhost:9200/miplog-%25%25%7Benv%7D-2015.08.19)  
curl -XDELETE [http://localhost:9200/miplog-%{env}-2015.08.19](http://localhost:9200/miplog-%25%7Benv%7D-2015.08.19)  
curl -XDELETE [http://localhost:9200/miplog-\%{env}-2015.08.19](http://localhost:9200/miplog-%5C%25%7Benv%7D-2015.08.19)

Thanx for help in advance!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 19, 2015, 8:24am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-delete-index-containing-character/27647/2 "2015-08-19T08:24:45Z")

</div>

Percent signs are URL encoded as %25 so try this:

```
curl -XDELETE http://localhost:9200/miplog-%25{env}-2015.08.19
```

---

<div class="post-metadata">

**Author:** ![MartinG](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MartinG](https://discuss.elastic.co/u/MartinG)\
**Post date:** [August 19, 2015, 8:41am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-delete-index-containing-character/27647/3 "2015-08-19T08:41:13Z")

</div>

Unfortunately it didn't work:

```
 curl -XDELETE http://localhost:9200/index-%25{env}-2015.08.19

```

{"error":"IndexMissingException[[index-%env-2015.08.19] missing]","status":404}[m000xxxx@xxxxxxxxx logstash]

---

<div class="post-metadata">

**Author:** ![MartinG](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MartinG](https://discuss.elastic.co/u/MartinG)\
**Post date:** [August 19, 2015, 8:44am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-delete-index-containing-character/27647/4 "2015-08-19T08:44:48Z")

</div>

.. but now I got it ...

@Magnus: you got me on the right track ... thanx a lot.

This worked:

```
 curl -XDELETE http://localhost:9200/index-%25%7Benv%7D-2015.08.19

```

{"acknowledged":true}[m000xxxx@xxxxxxxxx logstash]$

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:55pm UTC](https://discuss.elastic.co/t/elasticsearch-how-to-delete-index-containing-character/27647/5 "2017-07-05T23:55:04Z")

</div>


