Reindex / Shrink indices to original names - ElasticSearch Curator

605 views Asked by At

I am using Elasticsearch Curator to manage my indices. I want to shrink / reindex a given index and then rename it back to the original index name. I can do this manually because I know the indices name, but it's hard to do this using Curator. This is what I have right now:

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: 1
      number_of_replicas: 0
      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
      extra_settings:
        settings:
          index.codec: best_compression
      wait_for_completion: True
      wait_for_rebalance: True
      wait_interval: 9
      max_wait: -1
    filters:
      - filtertype: pattern
        kind: prefix
        value: myindex-
  2:
    action: reindex
    description: "Reindexing index to the original name"
    options:
      disable_action: False
      ignore_empty_list: True
      wait_for_active_shards: all
      wait_for_completion: True
      wait_interval: 9
      max_wait: -1
      request_body:
    source:
      index: REINDEX_SELECTION
    dest:
      index: index2 # not sure what to write here. I want to basically get rid of the suffix 'shrink'
    filters:
      - filtertype: pattern
        kind: suffix
        value: -shrink

For now, I can't use aliases so I want to shrink / reindex back to the original index

Elastic Search version: 7.2 Curator version: 5.8

Thanks!

0

There are 0 answers