ElasticSearch: how to delete index containing %-character?


#1

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
curl -XDELETE http://localhost:9200/miplog-%{env}-2015.08.19
curl -XDELETE http://localhost:9200/miplog-\%{env}-2015.08.19

Thanx for help in advance!


(Magnus B├Ąck) #2

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

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

#3

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]


#4

.. 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]$


(system) #5