Perform Elastalert index check twice

This commit is contained in:
Wes Lambert
2022-07-19 14:48:19 +00:00
parent 4a7c994b66
commit f3a0ab0b2d

View File

@@ -850,10 +850,10 @@ up_to_2.3.140() {
echo echo
exit 1 exit 1
fi fi
CHECK_COUNT=0
while [[ "$CHECK_COUNT" -le 2 ]]; do
# Delete Elastalert indices # Delete Elastalert indices
for i in $(so-elasticsearch-query _cat/indices | grep elastalert | awk '{print $3}'); for i in $(so-elasticsearch-query _cat/indices | grep elastalert | awk '{print $3}'); do
do
so-elasticsearch-query $i -XDELETE; so-elasticsearch-query $i -XDELETE;
done done
@@ -872,6 +872,9 @@ up_to_2.3.140() {
echo -n "." echo -n "."
fi fi
done done
((CHECK_COUNT+=1))
done
# If we were unable to delete the Elastalert indices, exit the script # If we were unable to delete the Elastalert indices, exit the script
if [ "$ELASTALERT_INDICES_DELETED" == "no" ]; then if [ "$ELASTALERT_INDICES_DELETED" == "no" ]; then