Delete or delete old data from elastic search

How to remove old data from the elastic search index, since the index has a large amount of data that is inserted every day.

+5
source share
2 answers

You can do this by uninstalling the plugin on request .

Assuming your index has a timestamp or creation date field, your query will look something like this:

 DELETE /your_index/your_type/_query { "query": { "range": { "timestamp": { "lte": "now-10y" } } } } 

This will delete records older than 10 years.

I hope this helps

+6
source

Split data into daily indexes and use an alias as the old index name. then delete each index daily. same as logstash:

Daily indices: logstash-20151011 , logstash-20151012 , logstash-20151013 .

Alias: logstash

Then delete the last index daily.

+4
source

Source: https://habr.com/ru/post/1237709/


All Articles