# Shrink do not proceed because of number of shard filter

**URL:** <https://discuss.elastic.co/t/shrink-do-not-proceed-because-of-number-of-shard-filter/352861>\
**Category:** Elasticsearch\
**Tags:** docker, curator\
**Created:** [February 8, 2024, 1:06pm UTC](https://discuss.elastic.co/t/shrink-do-not-proceed-because-of-number-of-shard-filter/352861 "2024-02-08T13:06:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teoman\_Sevinc](https://avatars.discourse-cdn.com/v4/letter/t/839c29/32.png) [@Teoman\_Sevinc](https://discuss.elastic.co/u/Teoman_Sevinc)\
**Post date:** [February 8, 2024, 1:06pm UTC](https://discuss.elastic.co/t/shrink-do-not-proceed-because-of-number-of-shard-filter/352861/1 "2024-02-08T13:06:07Z")

</div>

Hi Community,

I'm trying to shrink my indices with a curator.

This is my action.yml content:

```auto
actions:
  1:
    action: shrink
    description: "Shrink indices starting with mylog older than two days"
    options:
      allow_ilm_indices: true
      disable_action: False
      shrink_node: DETERMINISTIC
    filters:
      - filtertype: pattern
        kind: prefix
        value: mylog 
      - filtertype: age
        source: creation_date
        direction: older
        unit: days
        unit_count: 2

```

Even if I do not set any parameter regarding shard\_number, I see this log in the console:

```auto
2024-02-08 12:45:04,163 DEBUG curator.indexlist indices_exist:201 BEGIN indices_exist
2024-02-08 12:45:04,182 DEBUG curator.indexlist needs_data:281 These indices need data in index_info: []
2024-02-08 12:45:04,183 DEBUG curator.indexlist get_index_settings:310 Getting index settings -- END
2024-02-08 12:45:04,183 DEBUG curator.indexlist empty_list_check:400 Checking for empty list
2024-02-08 12:45:04,183 DEBUG curator.indexlist working_list:411 Generating working list of indices
2024-02-08 12:45:04,183 DEBUG curator.indexlist filter_by_shards:1064 Filter by number of shards: Index: mylog-2024.02.03
2024-02-08 12:45:04,183 DEBUG curator.indexlist __not_actionable:44 Index mylog-2024.02.03 is not actionable, removing from list.

```

As I understand, the curator application's default number\_of\_shards is "0" and the default shard\_filter\_behavior is "greater\_than"([curator/curator/indexlist.py at master · elastic/curator · GitHub](https://github.com/elastic/curator/blob/master/curator/indexlist.py) ). by the way indices' number\_of\_shards parameter is "1" .

example one of the index settings:

```auto
{
  "settings": {
    "index": {
      "lifecycle": {
        "name": "twoweekspolicy"
      },
      "routing": {
        "allocation": {
          "include": {
            "_tier_preference": "data_content"
          }
        }
      },
      "number_of_shards": "1",
      "provided_name": "mylog-2024.02.03",
      "creation_date": "1706572801447",
      "priority": "100",
      "number_of_replicas": "1",
      "version": {
        "created": "8030099"
      }
    }
  },

```

Curator version: docker image with "untergeek/curator:8.0.10" tag.  
Elastic version: "elasticsearch:8.3.0"

How Can configure the curator to ignore the "number of shards" filter for the shrink function?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 8, 2024, 1:25pm UTC](https://discuss.elastic.co/t/shrink-do-not-proceed-because-of-number-of-shard-filter/352861/2 "2024-02-08T13:25:17Z")

</div>

> [@Teoman\_Sevinc](#):
>
> `"number_of_shards": "1"`

Can you provide more context? The index you shared has 1 shard, is this after the shrink? It is not clear what is the issue here.

---

<div class="post-metadata">

**Author:** ![Teoman\_Sevinc](https://avatars.discourse-cdn.com/v4/letter/t/839c29/32.png) [@Teoman\_Sevinc](https://discuss.elastic.co/u/Teoman_Sevinc)\
**Post date:** [February 8, 2024, 3:15pm UTC](https://discuss.elastic.co/t/shrink-do-not-proceed-because-of-number-of-shard-filter/352861/3 "2024-02-08T15:15:20Z")

</div>

Hi @leandrojmp ,

I cannot shrink any indices. after the "shard filter" process, the curator's indices list becomes empty. The index I shared was one of the source indices I wanted to shrink.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 8, 2024, 3:27pm UTC](https://discuss.elastic.co/t/shrink-do-not-proceed-because-of-number-of-shard-filter/352861/4 "2024-02-08T15:27:37Z")

</div>

> [@Teoman\_Sevinc](#):
>
> The index I shared was one of the source indices I wanted to shrink.

The [Shrink API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shrink-index.html) is used to reduce the number of primary shards, if your index already has just one primary shard there is nothing to do.

That's why I asked of what you want to do, if your indices already have 1 shard, you cannot shrink them.

---

<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:** [March 7, 2024, 3:28pm UTC](https://discuss.elastic.co/t/shrink-do-not-proceed-because-of-number-of-shard-filter/352861/5 "2024-03-07T15:28:22Z")

</div>

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