How to remove data in an index of elastic search that is two week old

I have an index named "registration" in my elastic search.And i inserted data in that index through kibana.

Now i want to remove data in that index that is two weeks old.how can i do this

Better to use time based indices and just remove the indices.

Otherwise but much less efficient use the delete by query API.

i want to delete my log files in an index that are 2 weeks old automatically but not to delete my index.

how can i do this.

curator deletes whole index(as far i know),but i want to delete all logs(or)documents in an index that are 2 weeks old and this need to be done automatically every time

As David mentioned you will need to do this by periodically scheduling calls to the delete by query API. This is more expensive than deleting indices and not automated nor supported by Curator.

Generally a log line includes some sort of timestamp. Now I'm not well informed about the issue so maybe that suggestion may seem stupid, but is it possible to delete document based on the content of the log line ?

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