# Remote reindex with wildcard and script not working

**URL:** <https://discuss.elastic.co/t/remote-reindex-with-wildcard-and-script-not-working/82832>\
**Category:** Elasticsearch\
**Created:** [April 19, 2017, 7:34am UTC](https://discuss.elastic.co/t/remote-reindex-with-wildcard-and-script-not-working/82832 "2017-04-19T07:34:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_Vincent\_Ledou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierre_vincent_ledou/32/1368_2.png) [@Pierre\_Vincent\_Ledou](https://discuss.elastic.co/u/Pierre_Vincent_Ledou)\
**Post date:** [April 19, 2017, 7:34am UTC](https://discuss.elastic.co/t/remote-reindex-with-wildcard-and-script-not-working/82832/1 "2017-04-19T07:34:55Z")

</div>

I'm trying to import indices from an old node to a new cluster with the following request:

```
{
  "source": {
  	"remote": {
  	  "host": "http://my.host.com:9200",
  	  "username": "myuser",
  	  "password": "mypassword",
      "socket_timeout": "1m",
      "connect_timeout": "10s"	
  	},
    "index": "indexname-2017.02.*"
  },
  "dest": {
    "index": "indexname-2017-02"
  },
  "script": {
    "lang": "painless",
    "inline": "ctx._index = 'indexname-2017.02.' + (ctx._index.substring('indexname-2017.02.'.length(), ctx._index.length()))"
  }
}

```

But this create an big index indexname-2017-02 with all docs.

How can I re-create one index per day?

---

<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:** [May 17, 2017, 7:42am UTC](https://discuss.elastic.co/t/remote-reindex-with-wildcard-and-script-not-working/82832/2 "2017-05-17T07:42:20Z")

</div>

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