0

We have the following requirement: every month a new index (collection) has to be created: company_details- in ES cluster. We need to delete the older indices which are greater than 2 months.

Example:

company_details-2019-12 (delete this index)
company_details-2020-01 (retain this index)
company_details-2020-02 (retain this index)

We could create an alias company_details and point it to the current month index (so that we could do indexing/querying). This also has to be updated every month automatically.

How can we setup ES so that this would be done automatically?

Kate Orlova
  • 3,225
  • 5
  • 11
  • 35
Somebody
  • 23
  • 5

1 Answers1

0

If you are on a recent version of Elasticsearch, Index Lifecycle Management (ILM) (see Elasticsearch Reference: Manage the index lifecycle) can be used to automate all the tasks you described:

  • rolling over indices
  • adjusting links
  • optimize indices according to the life-cycle until they eventually get deleted
Daniel Schneiter
  • 1,843
  • 1
  • 13
  • 19