Remove old logs from elastic


(Rajesh M) #1

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.

regards
Rajesh


(Thiago Souza) #2

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


(Rajesh M) #3

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


(Thiago Souza) #4

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


(Rajesh M) #5

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


(system) #6

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