Skip to content

Instantly share code, notes, and snippets.

@mdrakiburrahman
Last active February 17, 2022 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdrakiburrahman/87707ddc7515db5927317757994fde19 to your computer and use it in GitHub Desktop.
Save mdrakiburrahman/87707ddc7515db5927317757994fde19 to your computer and use it in GitHub Desktop.
Cleanup of Elastic indices in Arc
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