# Shrinking an index if it is smaller than a certain value

**URL:** <https://discuss.elastic.co/t/shrinking-an-index-if-it-is-smaller-than-a-certain-value/187997>\
**Category:** Kibana\
**Tags:** ilm-index-lifecycle-management\
**Created:** [June 28, 2019, 8:45am UTC](https://discuss.elastic.co/t/shrinking-an-index-if-it-is-smaller-than-a-certain-value/187997 "2019-06-28T08:45:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bellicapelli0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bellicapelli0/32/48992_2.png) [@Bellicapelli0](https://discuss.elastic.co/u/Bellicapelli0)\
**Post date:** [June 28, 2019, 8:45am UTC](https://discuss.elastic.co/t/shrinking-an-index-if-it-is-smaller-than-a-certain-value/187997/1 "2019-06-28T08:45:10Z")

</div>

Goodmorning all,  
I am trying to implement this feature in my environment, and was wondering if it was possible:  
I have a log index that is created daily, and is mapped on 5 shards, 1 replica. At the end of the day, I want to check the size of the index and, if it is smaller than 10 GB, shrink it down to 2 shards, 1 replica.  
I've read through the index lifecycle management documentation and toyed around with the policy creation GUI, but I can't seem to produce the desired effect, as I can only reach the "warm" phase, which contains the shrink action, either unconditionally or using a condition that check if the index is larger than a certain value, not smaller.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [June 28, 2019, 2:03pm UTC](https://discuss.elastic.co/t/shrinking-an-index-if-it-is-smaller-than-a-certain-value/187997/2 "2019-06-28T14:03:41Z")

</div>

Hi Orlando,

Unfortunately this is not possible with ILM, we don't have conditional actions (other than rollover). I am wondering, though, why not just shrink all of the indices irregardless of size?

---

<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:** [July 26, 2019, 2:03pm UTC](https://discuss.elastic.co/t/shrinking-an-index-if-it-is-smaller-than-a-certain-value/187997/3 "2019-07-26T14:03:53Z")

</div>

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