Closed naithagoni closed 5 years ago
Thanks very much for your interest in Elasticsearch.
This appears to be a user question, and we'd like to direct these kinds of things to the forums. If you can stop by there, we'd appreciate it. This allows us to use GitHub for verified bug reports, feature requests, and pull requests.
There's an active community in the forums that should be able to help get an answer to your question. As such, I hope you don't mind that I close this.
I have a question regarding deleting the indices by date_formant(created date). I am using elasticsearch 6.4
For example, I have a indices structure as below:
logstash-2019.03.21 logstash-2019.03.20 logstash-2019.03.15 logstash-2019.03.10 logstash-2019.03.12 I want to delete the indices (not the documents) let say 3 days older`
NOTE: I have also used different ways, for example.
using date math: query {index: '%3Clogstash-%7Bnow-3d%7D%3E'}. this way, it only apply for the single index. 2.
let query = { index: 'logstash*', headers: null, body: { query: { range: { '@timestamp': { lt: 'now-2d' }, }, }, }, }; this deletes the documents not the indices.