Can't delete index for elasticsearch


(supermario) #1

i have a wrong index that named 'logstash-%{type}-%{item}-2015.09.30'. i want to delete it. when i delete it by curl -XDELETE(curl -XDELETE http://192.168.3.15:9200/logstash-%{type}-%{item}-2015.09.30) return 'curl: (52) Empty reply from server'.


(David Pilato) #2

You have to escape/encode special characters like %, {...


(supermario) #3

thank you , dadoonet. it's work good.


(Vani Aravinda) #4

Hi @dadoonet,

I'm trying to Delete the Index through Shell script. Please find below for the code. But I'm getting the error as "curl: (52) Empty reply from server". Please let me know if there is anything I'm doing wrong.

current=$(date +"%Y-%m-%d");
daybeforeyesterday=$( date -d "${current} -2 days" +'%Y.%m.%d' );
oldindex=ntest-$daybeforeyesterday;
echo $oldindex;
curl -XDELETE 'http://localhost:9200/'"$oldindex"''
echo

Thanks,
Vani Aravinda


(David Pilato) #5

It sounds like your server is not running or on another port or hostname?


(system) #6