es 清理索引
脚本------
#!/bin/bash
LAST_DATA=`date -d "-90 days" "+%Y-%m-%d"`
USERNAME='elastic'
PASSWORD='esDB%hbe'
URL="http://47.94.105.109:9200"
#curl -XDELETE --user ${USERNAME}:${PASSWORD} ${URL}'/*-'${LAST_DATA}
curl -XDELETE --user ${USERNAME}:${PASSWORD} ${URL}'/gateway-resp-log-'${LAST_DATA}
curl -XDELETE --user ${USERNAME}:${PASSWORD} ${URL}'/gateway-req-log-'${LAST_DATA}
curl -XDELETE --user ${USERNAME}:${PASSWORD} ${URL}'/gateway-log-'${LAST_DATA}
curl -XDELETE --user ${USERNAME}:${PASSWORD} ${URL}'/operation-log-'${LAST_DATA}
curl -XDELETE --user ${USERNAME}:${PASSWORD} ${URL}'/target-log-'${LAST_DATA}
命令:curl -XDELETE --user username:passwd http://127.0.0.1:9200'/gateway-resp-log*
无可奈何花落去,似曾相识燕归来