#!/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 "==================================================="

 

'ELK > elasticsearch' 카테고리의 다른 글

elasticsearch + java _api + match_all  (0) 2019.06.04
elasticsearch : count  (0) 2019.05.21
elastic 불용어 테스트  (0) 2019.05.01
python + bulk + insert + code  (0) 2019.04.24
elastic bacis#3  (0) 2019.04.23