# How to freeze only certain indices with Freeze Index API

**URL:** <https://discuss.elastic.co/t/how-to-freeze-only-certain-indices-with-freeze-index-api/173654>\
**Category:** Elasticsearch\
**Created:** [March 24, 2019, 9:48pm UTC](https://discuss.elastic.co/t/how-to-freeze-only-certain-indices-with-freeze-index-api/173654 "2019-03-24T21:48:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhasanbulli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhasanbulli/32/20653_2.png) [@mhasanbulli](https://discuss.elastic.co/u/mhasanbulli)\
**Post date:** [March 24, 2019, 9:48pm UTC](https://discuss.elastic.co/t/how-to-freeze-only-certain-indices-with-freeze-index-api/173654/1 "2019-03-24T21:48:17Z")

</div>

Hello,

I am looking into freezing some of the indices in our cluster. Is there a way to freeze only specific range of indices? For example, those that are earlier than 2019. I tried to use freeze with range query but ended up freezing every index under, for example, metricbeat-\*.

I am running into a similar situation with `forcemerge`. Is it possible to `forcemerge` only those indices that I am planning to freeze?

---

<div class="post-metadata">

**Author:** ![Yogesh\_Gaikwad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yogesh_gaikwad/32/27025_2.png) [@Yogesh\_Gaikwad](https://discuss.elastic.co/u/Yogesh_Gaikwad)\
**Post date:** [March 24, 2019, 11:53pm UTC](https://discuss.elastic.co/t/how-to-freeze-only-certain-indices-with-freeze-index-api/173654/2 "2019-03-24T23:53:45Z")

</div>

Hi @mhasanbulli,

I think what you observed is correct for Freeze API.  
I am not sure if you have looked at ILM (Index Lifecycle management) feature.  
From the description of the problem statement, I think ILM would help you with what you want to achieve.  
Following are some links from the documentation:  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.7/index-lifecycle-management.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/index-lifecycle-management.html)  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.7/\_actions.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/_actions.html)

Hope this helps

Thanks and Regards,  
Yogesh Gaikwad

---

<div class="post-metadata">

**Author:** ![mhasanbulli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhasanbulli/32/20653_2.png) [@mhasanbulli](https://discuss.elastic.co/u/mhasanbulli)\
**Post date:** [March 28, 2019, 12:53am UTC](https://discuss.elastic.co/t/how-to-freeze-only-certain-indices-with-freeze-index-api/173654/3 "2019-03-28T00:53:11Z")

</div>

Than you for your quick reply @Yogesh_Gaikwad. I was not aware of the ILM.

It seems like if the policy is attached to each index one by one from the Index Management page, it is only then the policy starts working.

There are also strict rules around if you are using a rollover. I mostly was wanting to use this for Beats indices and the trick is to set the policy with rollover turned off.

Cheers,  
Mus.

---

<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:** [April 25, 2019, 12:53am UTC](https://discuss.elastic.co/t/how-to-freeze-only-certain-indices-with-freeze-index-api/173654/4 "2019-04-25T00:53:13Z")

</div>

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