# Action Shrink n Reindex with Curator

**URL:** <https://discuss.elastic.co/t/action-shrink-n-reindex-with-curator/256028>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [November 19, 2020, 6:25pm UTC](https://discuss.elastic.co/t/action-shrink-n-reindex-with-curator/256028 "2020-11-19T18:25:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)\
**Post date:** [November 19, 2020, 6:25pm UTC](https://discuss.elastic.co/t/action-shrink-n-reindex-with-curator/256028/1 "2020-11-19T18:25:18Z")

</div>

Hello,

I need to shrink an index called log\_index\_ARC (too many shards/replicas).

Also, i want after shrink process, add an alias on new shrink index (log\_index\_ARC-shrink) to log\_index\_ARC (original value so).

Here my action file :  
$index=log\_index\_ARC

```
actions:
  1:
    action: shrink
    description: "Shrink index to have a different number of shards"
    options:
      disable_action: False
      ignore_empty_list: True
      shrink_node: DETERMINISTIC
      node_filters:
        permit_masters: False
      number_of_shards: 2
      number_of_replicas: 1
      shrink_prefix:
      shrink_suffix: '-shrink' # adds the shrink suffix which later I want to remove
      delete_after: True
      post_allocation:
        allocation_type: include
        key: node_tag
        value: cold
      wait_for_active_shards: 1
      wait_for_completion: True
      wait_for_rebalance: True
      wait_interval: 9
      max_wait: -1
    filters:
      - filtertype: pattern
        kind: prefix
        value: "'"$index"'"
  2:
    action: alias
    description: "Add/Remove selected indices to or from the specified alias"
    options:
      name: "'"$index"'"
    add:
      filters:
      - filtertype: pattern
      kind: suffix
      value: -shrink
    remove:
      filters:
      - filtertype: pattern
      kind: suffix
      value: -shrink

```

Can u help ? I miss on alias part ☹

Thanks

---

<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:** [December 17, 2020, 6:25pm UTC](https://discuss.elastic.co/t/action-shrink-n-reindex-with-curator/256028/2 "2020-12-17T18:25:18Z")

</div>

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