# Index pattern

**URL:** <https://discuss.elastic.co/t/index-pattern/383849>\
**Category:** Elasticsearch\
**Created:** [December 3, 2025, 10:48pm UTC](https://discuss.elastic.co/t/index-pattern/383849 "2025-12-03T22:48:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgomezf](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jgomezf](https://discuss.elastic.co/u/jgomezf)\
**Post date:** [December 3, 2025, 10:48pm UTC](https://discuss.elastic.co/t/index-pattern/383849/1 "2025-12-03T22:48:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 4, 2025, 4:10am UTC](https://discuss.elastic.co/t/index-pattern/383849/2 "2025-12-04T04:10:44Z")

</div>

Hi @jgomezf That is not the correct REST path

`curl -X DELETE https://localhost:9200/.ds-logs... `

> **[Delete indices | Elasticsearch API documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete)**
>
> Deleting an index deletes its documents, shards, and metadata.
> It does not delete related Kibana components, such as data views, visualizations, or dashboards.
> You cannot delete...

No `/indices` in the path just `/<index-name>`

---

<div class="post-metadata">

**Author:** ![jgomezf](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jgomezf](https://discuss.elastic.co/u/jgomezf)\
**Post date:** [December 4, 2025, 6:35pm UTC](https://discuss.elastic.co/t/index-pattern/383849/3 "2025-12-04T18:35:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 4, 2025, 9:40pm UTC](https://discuss.elastic.co/t/index-pattern/383849/4 "2025-12-04T21:40:22Z")

</div>

Hi @jgomezf

I think there is a little confusion, probably me

When you use DELETE

`DELETE <index-name>`

see [here](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete)

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`

See [Here `delete_by_query`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query)

It is not clear to me which one you want.

---

<div class="post-metadata">

**Author:** ![RainTown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raintown/32/140206_2.png) [@RainTown](https://discuss.elastic.co/u/RainTown)\
**Post date:** [December 4, 2025, 11:11pm UTC](https://discuss.elastic.co/t/index-pattern/383849/5 "2025-12-04T23:11:16Z")

</div>

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.
