Can't delete old indices older than 21 days

Hi,

I ran this in Kibana to delete the indices older than 21 days:
POST monstache.*/_delete_by_query
{
"query": {
"range": {
"@timestamp": {
"lte": "now-21d"
}
}
}
}

After ran it, I performed indices search and got lots of old indices returned:
yellow open monstache.stats.2020-07-07 Lz6PBgmAQ_Wi6S5Sf5d_Yg 5 1 2880 0 682.9kb 682.9kb
yellow open monstache.stats.2020-07-08 _yyFXGfYQpmw6qlDPohb8Q 5 1 2880 0 803.1kb 803.1kb
yellow open monstache.stats.2020-07-09 pEVHOzkVSGeftJduUTSIFg 5 1 2880 0 716.8kb 716.8kb
yellow open monstache.stats.2020-07-10 sAvO_gWwREKVfY4TogBTvQ 5 1 2880 0 784.1kb 784.1kb
yellow open monstache.stats.2020-07-11 uu_mPyCsSWymiW7P0MsZJw 5 1 2880 0 786kb 786kb
yellow open monstache.stats.2020-07-12 mKYu0MlYRkWk8IuAz1yMiw 5 1 2880 0 713kb 713kb

I noticed that all these old indices are still in open status.
My question is why I can't delete these old indices?

thanks
:+1:

Hello David,

What are you trying to do? Delete by Query does not delete the indices - it deletes the documents within while the indizes are kept. If you really want to delete the index do:

DELETE /monstache.stats.2020-07-07

Which version do you have? If you want to regularily delete old indizes ILM might be the right way for you as it allows to define when indizes should be deleted and more.

Best regards
Wolfram

1 Like

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