Delete elk old indices when not enough space
#!/bin/bash
CAPACITY=`df | grep '/dev/disk1' | awk '{print $5}' | tr -d '%'`
while [ $CAPACITY -gt 90 ]; do
INDEXNAME=`curl -s localhost:9200/_cat/indices/cloudwatch* | sort -n | head -1 | awk '{print $3}'`
curl -XDELETE localhost:9200/$INDEXNAME
echo "Deleted $INDEXNAME"
CAPACITY=`df | grep '<change this to disk>' | awk '{print $5}' | tr -d '%'`
sleep 60
done
Комментариев нет:
Отправить комментарий