查看索引
curl -XGET "http://localhost:9200/_cat/indices?v"
刪除自定義日志索引
#!/bin/bash
# 大於3天的索引
for ((i=3; i<=30; i ++))
do
echo $i
LAST_DATA1=`date -d "-$i days" "+%Y.%m.%d"`
LAST_DATA2=`date -d "-$i days" "+%Y%m%d"`
curl -XDELETE "http://127.0.0.1:9200/*-${LAST_DATA2}"
curl -XDELETE "http://127.0.0.1:9200/test*-${LAST_DATA1}"
done