0

I have elasticsearch indexes of the format "abc-xyz-yyyy-mm-dd". I have a requirement wherein I have to write a script to take two different dates as the input and then delete the indexes of the above format between these ranges using elasticsearch delete api. Can anyone suggest me how to get implement this?

coder2411
  • 9
  • 2
  • you mean to delete a range ? maybe you should take a look at Curator : https://github.com/elastic/curator/blob/master/examples/actions/delete_indices.yml or simply do it in code you do not have delete by range indices, you can delete with wildcard but do not seem to fit your need – ExploZe Aug 27 '21 at 08:33
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 27 '21 at 17:41
  • consider I have 30 indices in a folder. The indices names are as follows - "abc-xyz-2021-08-01", "abc-xyz-2021-08-02", "abc-xyz-2021-08-03", ........ "abc-xyz-2021-08-30". Now if I want to delete all the indices from 7th Aug - 20th Aug (abc-xyz-2021-08-07 - abc-xyz-2021-08-20) how can i do it? – coder2411 Aug 29 '21 at 10:45

0 Answers0