# Deleting a file in elasticsearch index

**URL:** <https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334>\
**Category:** Elasticsearch\
**Created:** [March 14, 2019, 12:27pm UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334 "2019-03-14T12:27:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 14, 2019, 12:27pm UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/1 "2019-03-14T12:27:47Z")

</div>

I am unable to delete a file in the elasticsearch index using the DELETE command, as my document id is: "E:/ELK\_Stack\_6.6.0/100 files compare/parsed xml 7.6v\USA\_ENG\_10077.doc001.out".  
So how do I delete the document? Is there any alternate method to do so?  
If so please help me!!!

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [March 14, 2019, 12:47pm UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/2 "2019-03-14T12:47:05Z")

</div>

I think you should be able to delete this by escaping the special characters. Something along the lines of:

`curl -XDELETE 'localhost:9200/badid/type/E:%2fELK_Stack_6.6.0%2f100%20files%20compare%2fparsed%20xml%207.6v\USA_ENG_10077.doc001.out'`

should do it.

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 14, 2019, 12:49pm UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/3 "2019-03-14T12:49:54Z")

</div>

Actually, I am working with windows, so how do I do it in that?

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [March 14, 2019, 2:02pm UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/4 "2019-03-14T14:02:36Z")

</div>

Which tool do you normally use to interact with elasticsearch? I do not run windows but may be able to help if I know the tool.

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [March 14, 2019, 3:00pm UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/5 "2019-03-14T15:00:24Z")

</div>

You can of course also do this through the kibana Dev tools console. You just have to use the % escaping, something like:

```auto
DELETE badid/type/E:%2fELK_Stack_6.6.0%2f100%20files%20compare%2fparsed%20xml%207.6v%5cUSA_ENG_10077.doc001.out

```

only difference is that \ (backslash) character has also been escaped, since it seems kibana would otherwise turn that into a / (forwards slash).

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 15, 2019, 7:00am UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/6 "2019-03-15T07:00:48Z")

</div>

> [@HenningAndersen](#):
>
> E:%2fELK\_Stack\_6.6.0%2f100%20files%20compare%2fparsed%20xml%207.6v%5cUSA\_ENG\_10077.doc001.out

Thankyou very much Iwas able to delete it.

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 20, 2019, 5:34am UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/7 "2019-03-20T05:34:28Z")

</div>

Can you please tell me what %2, %20, etc... refers?

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [March 20, 2019, 5:50am UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/8 "2019-03-20T05:50:18Z")

</div>

Those are html encoding characters.

[Read all about them ref\_urlencode](https://www.w3schools.com/tags/ref_urlencode.asp)

---

<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:** [April 17, 2019, 5:52am UTC](https://discuss.elastic.co/t/deleting-a-file-in-elasticsearch-index/172334/9 "2019-04-17T05:52:17Z")

</div>

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