Logstash index automatically delete when new is created

I want to create a script that previous day index got deleted when new index created in logstash config file.

Index1: 2018-01-01
Index2: 2018-01-02
.
.
.
IndexN:

Regards,
Dinesh D

Instead of deleting index daily, create an index with unique id, so that you can update your data daily from the same index. Deleting index is not a good approach.

Why not just use a custom _id for each document, so that the next time it gets sent to Elasticsearch it just overwrites the existing one?

Hi Balumurari,

Actually the index created based on the current date and my question is to keep only 7 days indices and past indices to be deleted.
And for this week indices should be deleted automatically when new week index is created.

Please suggest.

Regards,
Dinesh D

For now, use Elasticsearch Curator.

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