# Scheduled cross-cluster \_reindex

**URL:** <https://discuss.elastic.co/t/scheduled-cross-cluster-reindex/308230>\
**Category:** Elasticsearch\
**Created:** [June 27, 2022, 10:32am UTC](https://discuss.elastic.co/t/scheduled-cross-cluster-reindex/308230 "2022-06-27T10:32:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrystalDesignDR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/crystaldesigndr/32/114545_2.png) [@CrystalDesignDR](https://discuss.elastic.co/u/CrystalDesignDR)\
**Post date:** [June 27, 2022, 10:32am UTC](https://discuss.elastic.co/t/scheduled-cross-cluster-reindex/308230/1 "2022-06-27T10:32:26Z")

</div>

Hi,

we have various elastic cloud deployments where we would need to copy data from one cluster to another (with filters).  
We found that we can do this with POST \_reindex

Now to my question:  
Is there a way to schedule a task right within elastic to trigger this corss cluster \_reindex that gets the data from the last 7 days?  
Or should such actions be performed from an outside cronjob that sends this request to elastic?

Example reindex:

```json
POST _reindex
{
  "source": {
    "remote": {
      "host": "https://remotehost",
      "username": "elastic",
      "password": "??"
    },
    "index": "remoteindex*",
    "query": {
      "bool": {
        "filter": [
          {
            "range": {
              "@timestamp": {
                "gte": "2021-01-01T00:00:00.000Z",
                "lte": "2022-07-01T00:00:00.000Z",
                "format": "strict_date_optional_time"
              }
            }
          },
          {
            "match_phrase": {
              "labels.somelabel.keyword": "somevalue"
            }
          },
          {
            "bool": {
              "should": [
                {
                  "match_phrase": {
                    "client.somelabel2.keyword": "somevalue2"
                  }
                },
                {
                  "match_phrase": {
                    "client.somelabel3.keyword": "somevalue3"
                  }
                }
              ],
              "minimum_should_match": 1
            }
          }
        ]
      }
    }  
  },
  "dest": {
    "index": "dstindex"
  }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 28, 2022, 12:52am UTC](https://discuss.elastic.co/t/scheduled-cross-cluster-reindex/308230/2 "2022-06-28T00:52:46Z")

</div>

There's not, no. Generally it would be requested from outside Elasticsearch, via a cron'd script as you suggest.

It might be worth raising a feature request for this though.

---

<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, 2022, 12:53am UTC](https://discuss.elastic.co/t/scheduled-cross-cluster-reindex/308230/3 "2022-07-26T00:53:27Z")

</div>

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