Remove old logs from elastic

I have written a query to load two months data to elasticsearch. I would like only two months data to be retained at any point of time. which means in the third month the first months data should not be shown.

Is this possible.


You want to delete everything that is +2 months old or simply filter out?

I would like to delete +2 months old and only keep 2 months data.

Elasticsearch won't do that automatically for you and you need to schedule an external script to that.

For assisting with that script you can use a tool called Curator that allows defining high level rules for managing indices and snapshot/restore.

There is also an article that explains for to run Curator on AWS Lambda

Thanks for your help. Let me see how to get that done.:grin:

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