How to delete the data from ES index?
To delete indices/data, the best approach is to use the Delete API:
- More details and examples: Indices delete
- One should also run _cat/indices API first to see what all indices you have currently in the cluster and then delete accordingly: Cat Indices
To delete data collected for specific indices. One can either delete data periodically with a tool like Curator , or by using the Delete By Query API or the Kibana Index Management UI . There are no recommendations of best practices on data retention in ES, but it is suggested to keep the logs table around 1-2 million records at the most for SQL.