Elasticseearch基本查询语句
//查看_cat支持的信息
kibana: GET /_cat
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat'
//查看主节点信息
kibana: GET /_cat/master?v
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/master?v'
//查看集群所有节点
kibana: GET /_cat/nodes?v
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/nodes?v'
//查看所有索引信息
kibana: GET /_cat/indices?v
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/indices?v'
//查看单个索引信息
kibana: GET /_cat/indices/movies?v
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/indices/movies?v'
//查看所有分片信息
kibana: GET /_cat/shards?v
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/shards?v'
//查看单个索引分片信息
kibana: GET /_cat/shards/movies?v
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/shards/movies?v'
//查看集群健康状态
kibana: GET /_cat/health?v
kibana: GET _cluster/health
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/health?v'
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cluster/health?pretty'
//查看插件
kibana: GET /_cat/plugins?v
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/plugins?v'
//查看所有索引文档总数
kibana: GET _all/_count
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_all/_count?pretty'
//查看指定索引文档总数
kibana: GET movies/_count
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/movies/_count?pretty'
//查看所有模板
kibana: GET _cat/templates
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/templates?v'
//查看状态为绿的索引
kibana: GET /_cat/indices?v&health=green
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/indices?v&health=green'
//查看movies索引元数据
kibana: GET movies
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/movies?pretty'
//按照文档数量排序索引
kibana: GET _cat/indices?v&s=docs.count:desc
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/indices?v&s=docs.count:desc'
//查看各个索引占用内存大小并进行排序
kibana:
bash: curl -XGET -u elastic:password 'http://192.168.31.215:9201/_cat/indices?v&h=i,tm&s=tm:desc'