# Unable to delete the indices using Delete api

**URL:** <https://discuss.elastic.co/t/unable-to-delete-the-indices-using-delete-api/170309>\
**Category:** Elasticsearch\
**Created:** [February 28, 2019, 9:57am UTC](https://discuss.elastic.co/t/unable-to-delete-the-indices-using-delete-api/170309 "2019-02-28T09:57:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nithani25](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nithani25/32/33457_2.png) [@Nithani25](https://discuss.elastic.co/u/Nithani25)\
**Post date:** [February 28, 2019, 9:57am UTC](https://discuss.elastic.co/t/unable-to-delete-the-indices-using-delete-api/170309/1 "2019-02-28T09:57:15Z")

</div>

HI Team  
I have accumulated some really bad indices in my elastic datastore. These indices were created because of incorrect fields name which were used while indexing them.

```
Example Index Name:
 
projectname-logtype-%{log_source}-2019.02.01 

```

while most of the indices were successfully created, there are some with %{log\_source} which seems to have come from some indefinite source.

Delete index name does not allow me to delete the same.

Examples:

```
project-log-%{log_source}-2019.01.01
project-log-%{log_source}-2019.01.02
project-log-%{log_source}-2019.01.03
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 28, 2019, 10:23am UTC](https://discuss.elastic.co/t/unable-to-delete-the-indices-using-delete-api/170309/2 "2019-02-28T10:23:01Z")

</div>

Try to escape or URL encode those index names.

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [February 28, 2019, 11:28am UTC](https://discuss.elastic.co/t/unable-to-delete-the-indices-using-delete-api/170309/3 "2019-02-28T11:28:09Z")

</div>

can you share the code which you tried to delete the index

---

<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:** [March 28, 2019, 11:28am UTC](https://discuss.elastic.co/t/unable-to-delete-the-indices-using-delete-api/170309/4 "2019-03-28T11:28:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
