# ROTATE ML INDEXES

**URL:** <https://discuss.elastic.co/t/rotate-ml-indexes/339286>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [July 26, 2023, 9:31am UTC](https://discuss.elastic.co/t/rotate-ml-indexes/339286 "2023-07-26T09:31:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lopez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_lopez/32/50639_2.png) [@Daniel\_Lopez](https://discuss.elastic.co/u/Daniel_Lopez)\
**Post date:** [July 26, 2023, 9:31am UTC](https://discuss.elastic.co/t/rotate-ml-indexes/339286/1 "2023-07-26T09:31:47Z")

</div>

Hi to everyone!

I was trying to apply an ILM to ML Job, but I couldn't found nothing related with ilm in machines learning job configuration

Does someone how to do it?

---

<div class="post-metadata">

**Author:** ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)\
**Post date:** [July 26, 2023, 10:00am UTC](https://discuss.elastic.co/t/rotate-ml-indexes/339286/2 "2023-07-26T10:00:06Z")

</div>

ILM cannot be used on ML results indices. ILM _is_ used on the ML state index out-of-the-box.

For ML results indices we would need to do something more complex than ILM. We have had this issue open for years but never had time to do anything about it: [[ML] Add an ML results index rollover endpoint · Issue #29946 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/29946)

The size of each ML results index can be kept down by using a custom index per job instead of the shared results index.

---

<div class="post-metadata">

**Author:** ![Daniel\_Lopez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_lopez/32/50639_2.png) [@Daniel\_Lopez](https://discuss.elastic.co/u/Daniel_Lopez)\
**Post date:** [August 23, 2023, 7:02am UTC](https://discuss.elastic.co/t/rotate-ml-indexes/339286/3 "2023-08-23T07:02:43Z")

</div>

Hi team!

I could applied a method to rotate the index, and it is so simple to use ILM with ML indexes.

When you create a ML job. It writes in elastic with and .write index name, and it is simple, if at the begging you create a index with this rollover alias .write and associate it to an ILM, when you start the ml job the job starts to write in that index, and ILM works properly.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 20, 2023, 7:03am UTC](https://discuss.elastic.co/t/rotate-ml-indexes/339286/4 "2023-09-20T07:03:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
