ELK/elasticsearch
elasticsearch + shell01
파아랑새
2019. 5. 11. 11:59
#!/bin/bash
index_name=$1
if [ "$index_name" != "" ];then
curl -X GET "http://192.168.240.10:9200/{$index_name}/_count?pretty"
fi
실행
...더보기
$ ./index-count.sh kimjh
{
"count" : 17,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
}
}
#!/bin/bash
echo "==================================================="
echo " (주) "
echo " 날짜 : `date "+%Y-%m-%d"`"
echo " 작성자 : 김준현/ 매니져"
echo "==================================================="
response=$(curl -XGET 'http://192.168.240.10:9200/_cat/indices/test*?pretty')
echo $response
echo "==================================================="