Deleting a file in elasticsearch index

(Mohammed Saqib ) #1

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!!!

(Henning Andersen) #2

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.

(Mohammed Saqib ) #3

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

(Henning Andersen) #4

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.

(Henning Andersen) #5

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

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).

(Mohammed Saqib ) #6

Thankyou very much Iwas able to delete it.

(Mohammed Saqib ) #7

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

(Paul Janzen) #8

Those are html encoding characters.

Read all about them ref_urlencode

(system) closed #9

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