We have worked with the version elastic 8.4.10 and we cannot delete old index through curl delete https:localhost:9200/indices/ds.logsxxx{yesterday}*. Do you have any idea as delete old index through scripts
Thanks
We have worked with the version elastic 8.4.10 and we cannot delete old index through curl delete https:localhost:9200/indices/ds.logsxxx{yesterday}*. Do you have any idea as delete old index through scripts
Thanks
Hi @jgomezf That is not the correct REST path
curl -X DELETE https://localhost:9200/.ds-logs...
No /indices in the path just /<index-name>
Hi Stephenb for your answer. The curl you have configured that delete 2 days and we have detected that we have index 3 days ago. It possible modify that delete the old index until two days.
Thanks
Hi @jgomezf
I think there is a little confusion, probably me
When you use DELETE
DELETE <index-name>
see here
That deletes an entire index, whether it has 1 document or 1M documents, whether it Spans 1 Sec or 1 year, that deletes that entire index.
If you want to delete specific document IN and index you would use delete_by_query
It is not clear to me which one you want.
First find all the indices you need/wish to delete, via
curl -X GET “https:localhost:9200/_cat/indices?index=.ds*&h=index,health,dc,ss&s=cd&bytes=b"
(thats all on a single line)
That will sort the list of indices that matching “.ds*” in index-create-date order. also showing you its health state and number of docs and bytes used by the index.
If unsure, post here.
Then delete the ones you wish to delete, one at a time. Let's say you want to delete the index called .ds-logs.whatever-2025.12.01
curl -X DELETE “https:localhost:9200/.ds-logs.whatever-2025.12.01"
You should also probably also read the documuntation on “Data Streams” and “ILM - aka Index Lifecycle Management”.
If I have misunderstood your query, please try again with a more detailed description.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.