-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[opensearch-logs] remove insecure flags
- Loading branch information
Showing
3 changed files
with
10 additions
and
9 deletions.
There are no files selected for viewing
15 changes: 8 additions & 7 deletions
15
system/opensearch-logs/templates/config/_index_cleanup.sh.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
#!/bin/bash | ||
|
||
export HOST=https://opensearch-logs-client:9200 | ||
#job to delete wrongly created indexes, which have timestamps in the future | ||
export HOST=https://opensearch-logs-client.{{ .Values.global.clusterType}}.{{ .Values.global.region }}.{{ .Values.global.tld }}:9200 | ||
export CLEANUP_INDEXES="kubernikus virtual scaleout" | ||
|
||
export LC_ALL=C.UTF-8; export LANG=C.UTF-8 | ||
|
||
for i in ${CLEANUP_INDEXES} | ||
do | ||
export TO_DELETE_NEAR_FUTURE=`curl --insecure -s -u "${ADMIN_USER}:${ADMIN_PASSWORD}" ${HOST}/_aliases?pretty=true|grep $i | grep '20[0,1,3-9]'|awk '{ print $1}'|tr -d '"'` | ||
export TO_DELETE_NEAR_FUTURE=`curl -s -u "${ADMIN_USER}:${ADMIN_PASSWORD}" ${HOST}/_aliases?pretty=true|grep $i | grep '20[0,1,3-9]'|awk '{ print $1}'|tr -d '"'` | ||
for e in ${TO_DELETE_NEAR_FUTURE} | ||
do | ||
echo -e "Deleting index $e" | ||
curl --insecure -u "${ADMIN_USER}:${ADMIN_PASSWORD}" -X DELETE ${HOST}/$e?pretty | ||
curl -u "${ADMIN_USER}:${ADMIN_PASSWORD}" -X DELETE ${HOST}/$e?pretty | ||
done | ||
export TO_DELETE_FUTURE=`curl --insecure -s -u "${ADMIN_USER}:${ADMIN_PASSWORD}" ${HOST}/_aliases?pretty=true|grep $i | grep '2[1-9][0-9][0-9]'|awk '{ print $1}'|tr -d '"'` | ||
export TO_DELETE_FUTURE=`curl -s -u "${ADMIN_USER}:${ADMIN_PASSWORD}" ${HOST}/_aliases?pretty=true|grep $i | grep '2[1-9][0-9][0-9]'|awk '{ print $1}'|tr -d '"'` | ||
for p in ${TO_DELETE_FUTURE} | ||
do | ||
echo -e "Deleting index $p" | ||
curl --insecure -u "${ADMIN_USER}:${ADMIN_PASSWORD}" -X DELETE ${HOST}/$p?pretty | ||
curl -u "${ADMIN_USER}:${ADMIN_PASSWORD}" -X DELETE ${HOST}/$p?pretty | ||
done | ||
export TO_DELETE_PAST=`curl --insecure -s -u "${ADMIN_USER}:${ADMIN_PASSWORD}" ${HOST}/_aliases?pretty=true|grep $i | grep '19[0-9][0-9]'|awk '{ print $1}'|tr -d '"'` | ||
export TO_DELETE_PAST=`curl -s -u "${ADMIN_USER}:${ADMIN_PASSWORD}" ${HOST}/_aliases?pretty=true|grep $i | grep '19[0-9][0-9]'|awk '{ print $1}'|tr -d '"'` | ||
for d in ${TO_DELETE_FUTURE} | ||
do | ||
echo -e "Deleting index $d" | ||
curl --insecure -u "${ADMIN_USER}:${ADMIN_PASSWORD}" -X DELETE ${HOST}/$d?pretty | ||
curl -u "${ADMIN_USER}:${ADMIN_PASSWORD}" -X DELETE ${HOST}/$d?pretty | ||
done | ||
done |
2 changes: 1 addition & 1 deletion
2
system/opensearch-logs/templates/config/_install-index-pattern.sh.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters