Last active
February 17, 2022 13:09
-
-
Save mdrakiburrahman/87707ddc7515db5927317757994fde19 to your computer and use it in GitHub Desktop.
Cleanup of Elastic indices in Arc
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
URL="http://localhost:9200" | |
from=20 | |
to=30 | |
for i in `seq $from $to` | |
do | |
# Delete index if older than i days | |
DATE=`date -d "$dataset_date - $i days" +%Y.%m.%d` | |
echo "Deleting day: $DATE" | |
curl -XDELETE "$URL/logstash-$DATE" # Comment out to see what range is deleted | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment