Ensure Elastalert indices are deleted before continuing with SOUP -- if they are not, generate a failure condition

This commit is contained in:
weslambert
2022-07-13 08:38:55 -04:00
committed by GitHub
parent d7eb8b9bcb
commit 8e92060c29

View File

@@ -851,6 +851,13 @@ up_to_2.3.140() {
# Delete Elastalert indices # Delete Elastalert indices
for i in $(so-elasticsearch-query _cat/indices | grep elastalert | awk '{print $3}'); do so-elasticsearch-query $i -XDELETE; done for i in $(so-elasticsearch-query _cat/indices | grep elastalert | awk '{print $3}'); do so-elasticsearch-query $i -XDELETE; done
# Check to ensure Elastalert indices have been deleted
RESPONSE=$(so-elasticsearch-query elastalert*)
if [[ "$RESPONSE" == "{}" ]]; then
echo "Elastalert indices have been deleted."
else
fail "Something went wrong. Could not delete the Elastalert indices. Exiting."
fi
## ##
INSTALLEDVERSION=2.3.140 INSTALLEDVERSION=2.3.140
} }