Remote reindex with wildcard and script not working

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?

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