Seleccionar página


# Script para eliminar indices de un rango de dias en ElasticSearch

startdate=2017-07-01
enddate=2017-07-31

curr="$startdate"
while true; do
[ "$curr" \< "$enddate" ] || break
curr=$( date +%Y-%m-%d --date "$curr +1 day" )
echo "$curr"

currurl=$( date +%Y.%m.%d --date "$curr" )
url=$(echo "127.0.0.1:9200/logstash-$currurl?pretty")
echo "$url"
curl --noproxy 127.0.0.1 -XDELETE "$url"

done

Share