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*

posted @ 2023-06-19 11:17  哦~杰克  阅读(167)  评论(0编辑  收藏  举报