reindex索引,按某个时间字段

原索引log-collect-2021.07.*,按照索引里的OpTime整理索引,reindex为新索引index_name-时间

{
"source": {
"index": "log-collect-2021.07.*"
},
"dest": {
"index": "index_name-"
},
"script": {
"inline": "def sf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");def o = new SimpleDateFormat("yyyy.MM.dd");def dt = sf.parse(ctx._source.OpTime);ctx._index='index_name-' + o.format(dt);"
}
}

你可能感兴趣的:(reindex索引,按某个时间字段)