Hi All,
_reindex is not working when i pass index names as a variable.
###Create New index for Backup
index_name="test"
create_index="test-bkp"
curl -s -u username:password -XPUT "http://localhost:9200/$create_index"
###Copy Existing Index
curl -s -u username:password -XPOST 'http://localhost:9200/_reindex?pretty' -H 'Content-Type: application/json' -d'
{
"source": {
"index": "$index_name"
},
"dest": {
"index": "$create_index"
}
}
'
=== Working if i speicfy index names like below
###Create New index for Backup
index_name="test"
create_index="test-bkp"
curl -s -u username:password -XPUT "http://localhost:9200/$create_index"
###Copy Existing Index
curl -s -u username:password -XPOST 'http://localhost:9200/_reindex?pretty' -H 'Content-Type: application/json' -d'
{
"source": {
"index": "test"
},
"dest": {
"index": "test-bkp"
}
}
'
Could any one suggest as i am trying to automate this with shell script
Thanks