Merge pull request #8288 from Security-Onion-Solutions/fix/soup_elastalert_indices_deletion_check

Ensure Elastalert indices are deleted before continuing with SOUP
This commit is contained in:
weslambert
2022-07-13 08:44:04 -04:00
committed by GitHub

View File

@@ -851,6 +851,13 @@ up_to_2.3.140() {
# Delete Elastalert indices
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
}