diff --git a/jobs/upload_opensearch_config/templates/bin/upload-config.erb b/jobs/upload_opensearch_config/templates/bin/upload-config.erb index 56e2a9b4..d5009b09 100755 --- a/jobs/upload_opensearch_config/templates/bin/upload-config.erb +++ b/jobs/upload_opensearch_config/templates/bin/upload-config.erb @@ -116,7 +116,7 @@ echo "--- License" <% end %> echo "--- Creating ISM policy" -curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs-app-rollover_policy -H 'Content-Type: application/json' -d'{"policy":{"description":"Rollover to a new index when age or size becomes our target","default_state":"Rollover","states":[{"name":"Rollover","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"rollover":{"min_index_age":"'${INDEX_AGE}'","min_primary_shard_size":"'${DOCUMENT_SIZE}'","copy_alias":false}},{"read_only": {}}],"transitions":[]}],"ism_template":[{"index_patterns":["logs-app-*"],"priority":100}]}}' +curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs-app-rollover_policy -H 'Content-Type: application/json' -d'{"policy":{"description":"Rollover to a new index when age or size becomes our target","default_state":"Rollover","states":[{"name":"Rollover","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"rollover":{"min_index_age":"'${INDEX_AGE}'","min_primary_shard_size":"'${DOCUMENT_SIZE}'","copy_alias":false}}],"transitions":[]}],"ism_template":[{"index_patterns":["logs-app-*"],"priority":100}]}}' HTTP_CODE=$(curl -s -o /dev/null -s -w "%{http_code}\n" -I ${CA} ${CERT} ${KEY} ${BASEURL}/_alias/${ALIAS}/ ) if [ "$HTTP_CODE" -ge "201" ]; then curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/%3Clogs-app-%7Bnow%2Fd%7D-01%3E -H 'Content-Type: application/json' -d'{"aliases": {"'${ALIAS}'": {}}}'