Elasticsearch cat Apis
1、_cat列入所有有效命令
GET /_cat返回:有个猫...所以不难想象为啥是cat api =^.^= /_cat/allocation /_cat/shards /_cat/shards/{index} /_cat/master /_cat/nodes /_cat/tasks /_cat/indices /_cat/indices/{index} /_cat/segments /_cat/segments/{index} /_cat/count /_cat/count/{index} /_cat/recovery /_cat/recovery/{index} /_cat/health /_cat/pending_tasks /_cat/aliases /_cat/aliases/{alias} /_cat/thread_pool /_cat/thread_pool/{thread_pools} /_cat/plugins /_cat/fielddata /_cat/fielddata/{fields} /_cat/nodeattrs /_cat/repositories /_cat/snapshots/{repository} /_cat/templates
2、通用参数
2.1 verbose参数,显示命令详细信息
GET /_cat/master?vresult: id host ip node Sa5md_zERDebxloO004ffQ 192.168.31.10 192.168.31.10 vmstation.es.1没有加?v的情况,result: Sa5md_zERDebxloO004ffQ 192.168.31.10 192.168.31.10 vmstation.es.1
2.2 help参数,显示有效列的详细说明
GET /_cat/master?helpresult: id | | node id host | h | host name ip | | ip address node | n | node name
2.3 header参数,选择显示的列
GET /_cat/nodes?h=ip,port,heapPercent,name result: 192.168.31.10 9300 43 vmstation.es.1
2.4、响应体返回格式,支持json,yaml,text(default),smile,cbor
json格式GET /_cat/indices?format=json&prettyresult: [{"health" : "green","status" : "open","index" : ".monitoring-kibana-6-2018.12.24","uuid" : "vkJltBs1T8qEfdUDdyDYzA","pri" : "1","rep" : "0","docs.count" : "1345","docs.deleted" : "0","store.size" : "453.3kb","pri.store.size" : "453.3kb"},{"health" : "green","status" : "open","index" : "user2","uuid" : "xo9Zb2OkRWeqV5bRKNDKGg","pri" : "1","rep" : "0","docs.count" : "12","docs.deleted" : "0","store.size" : "7.9kb","pri.store.size" : "7.9kb"},..... ]
2.5、多个参数混合使用,一个问号,参数用&连接
GET /_cat/nodes?v&h=ip,port,heapPercent,nameresult: ip port heapPercent name 192.168.31.10 9300 59 vmstation.es.1
2.6、排序sort,缺省是asc排序
GET /_cat/indices?v&h=health,index,store.size&s=store.size:descresult: health index store.size green .monitoring-es-6-2018.12.24 10mb green .monitoring-es-6-2018.12.20 5mb green .monitoring-es-6-2018.12.25 4.4mb green .monitoring-kibana-6-2018.12.24 453.3kb green .monitoring-kibana-6-2018.12.20 318kb green .monitoring-kibana-6-2018.12.25 195.2kb yellow bus 86kb yellow blog 34.3kb green shirts 25kb yellow home 16.8kb green user 13.7kb green .kibana_1 12kb green bus2 11.6kb green user2 7.9kb green user3 261b
多个字段排序: GET /_cat/indices?v&h=health,index,store.size,pri.store.size&s=store.size:desc,pri.store.size:descresult: health index store.size pri.store.size green .monitoring-es-6-2018.12.24 10mb 10mb green .monitoring-es-6-2018.12.20 5mb 5mb green .monitoring-es-6-2018.12.25 4.6mb 4.6mb green .monitoring-kibana-6-2018.12.24 453.3kb 453.3kb green .monitoring-kibana-6-2018.12.20 318kb 318kb green .monitoring-kibana-6-2018.12.25 202.4kb 202.4kb yellow bus 86kb 86kb yellow blog 34.3kb 34.3kb green shirts 25kb 25kb yellow home 16.8kb 16.8kb green user 13.7kb 13.7kb green .kibana_1 12kb 12kb green bus2 11.6kb 11.6kb green user2 7.9kb 7.9kb green user3 261b 261b
3、aliases显示别名、过滤器、路由信息
GET /_cat/aliases?vresult: alias index filter routing.index routing.search .kibana .kibana_1 - - -
4、allocation显示每个数据节点分配多少碎片以及它们使用多少磁盘空间的快照
GET /_cat/allocation?v&format=jsonresult: [{"shards" : "20","disk.indices" : "21.4mb","disk.used" : "4gb","disk.avail" : "12.9gb","disk.total" : "16.9gb","disk.percent" : "23","host" : "192.168.31.10","ip" : "192.168.31.10","node" : "vmstation.es.1"},{"shards" : "7","disk.indices" : null,"disk.used" : null,"disk.avail" : null,"disk.total" : null,"disk.percent" : null,"host" : null,"ip" : null,"node" : "UNASSIGNED"} ] #7个碎片是曾经属于一个集群,现在只有单节点,但是索引建立的时候使用它作为副本,所以信息都是未知的。
5、count显示所有索引或者某个索引的文档数量
GET /_cat/count?vresult: epoch timestamp count 1545709338 03:42:18 47638
或者单个索引
GET /_cat/count/bus?vresult: epoch timestamp count 1545709383 03:43:03 27
6、fielddata
GET /_cat/fielddata?vresult: id host ip node field size Sa5md_zERDebxloO004ffQ 192.168.31.10 192.168.31.10 vmstation.es.1 type 552b
7、indices显示每个索引的横截面。此信息跨越节点。
GET /_cat/indices?vresult: health status index uuid pri rep docs.count docs.deleted store.size pri.store.size green open .monitoring-kibana-6-2018.12.24 vkJltBs1T8qEfdUDdyDYzA 1 0 1345 0 453.3kb 453.3kb green open user2 xo9Zb2OkRWeqV5bRKNDKGg 1 0 12 0 7.9kb 7.9kb yellow open bus G4DrNdPhRWK_rBuEaluwsA 3 1 27 3 86kb 86kb green open .monitoring-es-6-2018.12.25 Gl01crYyQImkxCTGvB3Xkg 1 0 16845 189 15.6mb 15.6mb green open shirts NLF5tjIuSz-JbUQcc_VbiQ 1 0 7 0 25kb 25kb green open .monitoring-kibana-6-2018.12.20 GRwFygbPRw62Qeoyg-68Mg 1 0 719 0 318kb 318kb green open .monitoring-kibana-6-2018.12.25 TmCzVC4wQrmmElX8Bbmjdg 1 0 866 0 710.2kb 710.2kb green open .monitoring-es-6-2018.12.20 IH3moZNyQfCHp8ZUjelmWA 1 0 9548 215 5mb 5mb yellow open home CSyKu2FJTZGtSIg0jOltcw 2 1 7 0 16.8kb 16.8kb green open .monitoring-es-6-2018.12.24 jCgptARpQ8S-B3Gn8adYSQ 1 0 23936 25 10mb 10mb yellow open blog G7leckf1RQGHNCZKROpBCg 2 1 33 6 34.3kb 34.3kb green open .kibana_1 olE1g78PTl-FxApa5LXhtg 1 0 3 0 12kb 12kb green open user3 -ArWuP3ZRsGsoiLwMxRyKQ 1 0 0 0 261b 261b green open bus2 j2ckAmxCRjuH6xVCU1aATA 1 0 27 0 11.6kb 11.6kb green open user WdRH_r9DSDOtySMxlRYe_g 2 0 12 0 13.7kb 13.7kb
单个索引(支持通配符):
GET /_cat/indices/bus*?v&h=index,status,pri,rep,docs.countresult: index status pri rep docs.count bus2 open 1 0 27 bus open 3 1 27
或者
GET /_cat/indices?v&index=bus*
8、master显示master节点
GET /_cat/master?vresult: id host ip node Sa5md_zERDebxloO004ffQ 192.168.31.10 192.168.31.10 vmstation.es.1
9、nodeattrs显示节点属性
GET /_cat/nodeattrs?v&h=node,id,pid,host,port,attr,valueresult: node id pid host port attr value vmstation.es.1 Sa5m 1763 192.168.31.10 9300 ml.machine_memory 1911832576 vmstation.es.1 Sa5m 1763 192.168.31.10 9300 xpack.installed true vmstation.es.1 Sa5m 1763 192.168.31.10 9300 ml.max_open_jobs 20 vmstation.es.1 Sa5m 1763 192.168.31.10 9300 ml.enabled true
10、nodes显示集群拓扑
GET /_cat/nodes?v&format=jsonresult: [{"ip" : "192.168.31.10","heap.percent" : "40","ram.percent" : "95","cpu" : "7","load_1m" : "0.25","load_5m" : "0.19","load_15m" : "0.13","node.role" : "mdi","master" : "*","name" : "vmstation.es.1"} ]
列内容包括:
id | id,nodeId | unique node id pid | p | process id ip | i | ip address port | po | bound transport port http_address | http | bound http address version | v | es version flavor | f | es distribution flavor type | t | es distribution type build | b | es build hash jdk | j | jdk version disk.total | dt,diskTotal | total disk space disk.used | du,diskUsed | used disk space disk.avail | d,da,disk,diskAvail | available disk space disk.used_percent | dup,diskUsedPercent | used disk space percentage heap.current | hc,heapCurrent | used heap heap.percent | hp,heapPercent | used heap ratio heap.max | hm,heapMax | max configured heap ram.current | rc,ramCurrent | used machine memory ram.percent | rp,ramPercent | used machine memory ratio ram.max | rm,ramMax | total machine memory file_desc.current | fdc,fileDescriptorCurrent | used file descriptors file_desc.percent | fdp,fileDescriptorPercent | used file descriptor ratio file_desc.max | fdm,fileDescriptorMax | max file descriptors cpu | cpu | recent cpu usage load_1m | l | 1m load avg load_5m | l | 5m load avg load_15m | l | 15m load avg uptime | u | node uptime node.role | r,role,nodeRole | m:master eligible node, d:data node, i:ingest node, -:coordinating node only master | m | *:current master name | n | node name completion.size | cs,completionSize | size of completion fielddata.memory_size | fm,fielddataMemory | used fielddata cache fielddata.evictions | fe,fielddataEvictions | fielddata evictions query_cache.memory_size | qcm,queryCacheMemory | used query cache query_cache.evictions | qce,queryCacheEvictions | query cache evictions request_cache.memory_size | rcm,requestCacheMemory | used request cache request_cache.evictions | rce,requestCacheEvictions | request cache evictions request_cache.hit_count | rchc,requestCacheHitCount | request cache hit counts request_cache.miss_count | rcmc,requestCacheMissCount | request cache miss counts flush.total | ft,flushTotal | number of flushes flush.total_time | ftt,flushTotalTime | time spent in flush get.current | gc,getCurrent | number of current get ops get.time | gti,getTime | time spent in get get.total | gto,getTotal | number of get ops get.exists_time | geti,getExistsTime | time spent in successful gets get.exists_total | geto,getExistsTotal | number of successful gets get.missing_time | gmti,getMissingTime | time spent in failed gets get.missing_total | gmto,getMissingTotal | number of failed gets indexing.delete_current | idc,indexingDeleteCurrent | number of current deletions indexing.delete_time | idti,indexingDeleteTime | time spent in deletions indexing.delete_total | idto,indexingDeleteTotal | number of delete ops indexing.index_current | iic,indexingIndexCurrent | number of current indexing ops indexing.index_time | iiti,indexingIndexTime | time spent in indexing indexing.index_total | iito,indexingIndexTotal | number of indexing ops indexing.index_failed | iif,indexingIndexFailed | number of failed indexing ops merges.current | mc,mergesCurrent | number of current merges merges.current_docs | mcd,mergesCurrentDocs | number of current merging docs merges.current_size | mcs,mergesCurrentSize | size of current merges merges.total | mt,mergesTotal | number of completed merge ops merges.total_docs | mtd,mergesTotalDocs | docs merged merges.total_size | mts,mergesTotalSize | size merged merges.total_time | mtt,mergesTotalTime | time spent in merges refresh.total | rto,refreshTotal | total refreshes refresh.time | rti,refreshTime | time spent in refreshes refresh.listeners | rli,refreshListeners | number of pending refresh listeners script.compilations | scrcc,scriptCompilations | script compilations script.cache_evictions | scrce,scriptCacheEvictions | script cache evictions search.fetch_current | sfc,searchFetchCurrent | current fetch phase ops search.fetch_time | sfti,searchFetchTime | time spent in fetch phase search.fetch_total | sfto,searchFetchTotal | total fetch ops search.open_contexts | so,searchOpenContexts | open search contexts search.query_current | sqc,searchQueryCurrent | current query phase ops search.query_time | sqti,searchQueryTime | time spent in query phase search.query_total | sqto,searchQueryTotal | total query phase ops search.scroll_current | scc,searchScrollCurrent | open scroll contexts search.scroll_time | scti,searchScrollTime | time scroll contexts held open search.scroll_total | scto,searchScrollTotal | completed scroll contexts segments.count | sc,segmentsCount | number of segments segments.memory | sm,segmentsMemory | memory used by segments segments.index_writer_memory | siwm,segmentsIndexWriterMemory | memory used by index writer segments.version_map_memory | svmm,segmentsVersionMapMemory | memory used by version map segments.fixed_bitset_memory | sfbm,fixedBitsetMemory | memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields suggest.current | suc,suggestCurrent | number of current suggest ops suggest.time | suti,suggestTime | time spend in suggest suggest.total | suto,suggestTotal | number of suggest ops
选择显示内容:
GET /_cat/nodes?v&format=json&h=id,i,p,http,v,j,dt,du,hc,hp,hx,rc,rp,rmresult: [{"id" : "Sa5m","i" : "192.168.31.10","p" : "1763","http" : "192.168.31.10:9200","v" : "6.5.1","j" : "1.8.0_172","dt" : "16.9gb","du" : "4.1gb","hc" : "461mb","hp" : "45","rc" : "1.6gb","rp" : "94","rm" : "1.7gb"} ]
11、显示正在等待的任务
GET /_cat/pending_tasks?vresult: insertOrder timeInQueue priority source1685 855ms HIGH update-mapping [foo][t]1686 843ms HIGH update-mapping [foo][t]1693 753ms HIGH refresh-mapping [foo][[t]]1688 816ms HIGH update-mapping [foo][t]1689 802ms HIGH update-mapping [foo][t]1690 787ms HIGH update-mapping [foo][t]1691 773ms HIGH update-mapping [foo][t]
12、plugins显示每个运行插件节点的视图,该信息跨节点。
GET /_cat/plugins?v&s=component&h=name,component,version,descriptionresult: name component version description vmstation.es.1 analysis-ik 6.5.1 IK Analyzer for Elasticsearch
13、recovery是正在进行的和先前完成的索引碎片恢复的视图。
只要索引碎片移动到集群中的不同节点,就会发生恢复事件。这可以在快照恢复、复制级别更改、节点失败或节点启动时发生。最后一种类型称为本地存储恢复,是当节点启动时从磁盘加载碎片的正常方式。
GET /_cat/recovery?v&format=jsonresult: [{"index" : "user2","shard" : "0","time" : "333ms","type" : "existing_store","stage" : "done","source_host" : "n/a","source_node" : "n/a","target_host" : "192.168.31.10","target_node" : "vmstation.es.1","repository" : "n/a","snapshot" : "n/a","files" : "0","files_recovered" : "0","files_percent" : "100.0%","files_total" : "4","bytes" : "0","bytes_recovered" : "0","bytes_percent" : "100.0%","bytes_total" : "8105","translog_ops" : "0","translog_ops_recovered" : "0","translog_ops_percent" : "100.0%"},{"index" : "bus","shard" : "0","time" : "388ms","type" : "existing_store","stage" : "done","source_host" : "n/a","source_node" : "n/a","target_host" : "192.168.31.10","target_node" : "vmstation.es.1","repository" : "n/a","snapshot" : "n/a","files" : "0","files_recovered" : "0","files_percent" : "100.0%","files_total" : "28","bytes" : "0","bytes_recovered" : "0","bytes_percent" : "100.0%","bytes_total" : "21695","translog_ops" : "0","translog_ops_recovered" : "0","translog_ops_percent" : "100.0%"},... ... ]
14、thread_pool显示线程池信息
GET /_cat/thread_pool?vresult: node_name name active queue rejected vmstation.es.1 analyze 0 0 0 vmstation.es.1 ccr 0 0 0 vmstation.es.1 fetch_shard_started 0 0 0 vmstation.es.1 fetch_shard_store 0 0 0 vmstation.es.1 flush 0 0 0 vmstation.es.1 force_merge 0 0 0 vmstation.es.1 generic 0 0 0 vmstation.es.1 get 0 0 0 vmstation.es.1 index 0 0 0 vmstation.es.1 listener 0 0 0 vmstation.es.1 management 1 0 0 vmstation.es.1 ml_autodetect 0 0 0 vmstation.es.1 ml_datafeed 0 0 0 vmstation.es.1 ml_utility 0 0 0 vmstation.es.1 refresh 0 0 0 vmstation.es.1 rollup_indexing 0 0 0 vmstation.es.1 search 0 0 0 vmstation.es.1 search_throttled 0 0 0 vmstation.es.1 security-token-key 0 0 0 vmstation.es.1 snapshot 0 0 0 vmstation.es.1 warmer 0 0 0 vmstation.es.1 watcher 0 0 0 vmstation.es.1 write 0 0 0
15、shards显示碎片视图
GET /_cat/shards?v&format=jsonresult: [{"index" : "bus2","shard" : "0","prirep" : "p","state" : "STARTED","docs" : "27","store" : "11.6kb","ip" : "192.168.31.10","node" : "vmstation.es.1"},{"index" : ".kibana_1","shard" : "0","prirep" : "p","state" : "STARTED","docs" : "3","store" : "12kb","ip" : "192.168.31.10","node" : "vmstation.es.1"}, ... ... ]
按索引显示:
GET /_cat/shards/bus?vresult: index shard prirep state docs store ip node bus 1 p STARTED 7 27.8kb 192.168.31.10 vmstation.es.1 bus 1 r UNASSIGNED bus 2 p STARTED 9 37kb 192.168.31.10 vmstation.es.1 bus 2 r UNASSIGNED bus 0 p STARTED 11 21.1kb 192.168.31.10 vmstation.es.1 bus 0 r UNASSIGNED
16、segments显示碎片中的分段信息
GET /_cat/segments?v&format=jsonresult: index shard prirep ip segment generation docs.count docs.deleted size size.memory committed searchable version compounduser2 0 p 192.168.31.10 _0 0 12 0 7.5kb 2726 true true 7.5.0 truebus 0 p 192.168.31.10 _q 26 7 3 5.3kb 1982 true true 7.5.0 falsebus 0 p 192.168.31.10 _r 27 1 0 3.7kb 1827 true true 7.5.0 truebus 0 p 192.168.31.10 _s 28 1 0 3.7kb 1827 true true 7.5.0 truebus 0 p 192.168.31.10 _t 29 1 0 3.7kb 1827 true true 7.5.0 truebus 0 p 192.168.31.10 _u 30 1 0 3.9kb 1965 true true 7.5.0 truebus 1 p 192.168.31.10 _7 7 1 0 3.9kb 1829 true true 7.5.0 truebus 1 p 192.168.31.10 _8 8 1 0 3.9kb 1829 true true 7.5.0 truebus 1 p 192.168.31.10 _9 9 1 0 3.9kb 1829 true true 7.5.0 truebus 1 p 192.168.31.10 _a 10 1 0 3.9kb 1829 true true 7.5.0 truebus 1 p 192.168.31.10 _b 11 1 0 3.9kb 1829 true true 7.5.0 truebus 1 p 192.168.31.10 _c 12 1 0 3.8kb 1829 true true 7.5.0 truebus 1 p 192.168.31.10 _f 15 1 0 3.5kb 1538 true true 7.5.0 true... ...
转载于:https://www.cnblogs.com/asker009/p/10173425.html
Elasticsearch cat Apis相关推荐
- 《Elasticsearch:权威指南》cat APIs -- cat indices(查看索引信息)
文章目录 cat indices Primaries 示例 哪些索引状态是 yellow ? 哪个索引的文件数最多? 指定显示哪些列 每一个索引使用了多少内存? 参数解释 cat indices in ...
- [Elasticsearch]cat API的使用
毕业没多久,由于工作原因,被老大安排学习elasticsearch并用于日志检索以提高线上日志的排查效率.那时候对于很多东西都没有概念,对elasticsearch的理解也不够全面,所以搞出来的东西也 ...
- 重磅!Elasticsearch 8 正式发布!
欢迎关注方志朋的博客,回复"666"获面试宝典 文 | Travis 出品 | OSC开源社区(ID:oschina2013) Elasticsearch 是一个基于 Lucene ...
- 【es】es 的 cat API是如何加载的
1.概述 转载:[5]elasticsearch源码深入分析--cat API是如何加载的 2.cat API的分类 cat API是esAPI中比较简单的一种,es中的API按照大类分为下面几种: ...
- Elasticsearch API简介
Elasticsearch提供了丰富的API. API主要有: Indices APIs:负责索引Index的创建(create).删除(delete).获取(get).索引存在(exist)等操作. ...
- Elasticsearch 7.x版本重大改变(Breaking changes in 7.x)
Breaking changes in 7.0 This section discusses the changes that you need to be aware of when migrati ...
- ElasticSearch + xpack 使用
ElasticSearch 是一个高可用开源全文检索和分析组件.提供存储服务,搜索服务,大数据准实时分析等.一般用于提供一些提供复杂搜索的应.我们为什么要选择 ElasticSearch ?因为它是一 ...
- CentOS7下Elasticsearch集群部署记录
Elasticsearch是一个分布式搜索服务,提供Restful API,底层基于Lucene,采用多shard的方式保证数据安全,并且提供自动resharding的功能,github等大型的站点也 ...
- ElasticSearch重启脚本
ES 重启脚本 [@es-master1 elasticsearch]$ cat /etc/init.d/elastic #!/bin/bash # #chkconfig:2345 98 14 #de ...
最新文章
- LINUX系统管理员技术(Admin)-------第三天
- 利用SQL模糊匹配来验证字段是否是日期格式
- 图像去模糊之初探--Single Image Motion Deblurring
- 用LIBSVM做回归和预测
- Linux常用命令 积累
- vaadin_Vaadin附加组件和Maven
- Dede更新提示DedeTag Engine Create File False的解决办法
- 借贷宝详细注册步骤:邀请朋友送20元,朋友再邀请朋友还送你10元【3天已赚6千】(附我的邀请记录和提现到账截图)...
- Python使用Scrapy爬虫框架爬取天涯社区小说“大宗师”全文
- javascript自制函数图像生成器
- 陆奇:疫情下的创业者,最不能缺这两大能力
- ftok() Linux Linux函数
- dns域名解析原理及过程
- java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor
- 虚拟歌手亮相央视元宵晚会,窥探背后的科技力量
- Win10数字权利激活批处理版
- 2021-08-09-ROS学习-消息创建,发布者和订阅者实现及测试
- Maven中央仓库地址大全,Maven中央仓库配置示例
- 设计新灵感:CA奖项背后的秘密
- 10分钟搞定 SpringBoot 如何优雅读取配置文件?
热门文章
- Arduino使用TM1637四位数码管
- 社团c语言程序设计,C语言课程设计-大学社团管理系统.doc
- uniapp自定义导航栏,高度,自定义组件
- 第一单元 用python学习微积分(五) 隐函数微分法和逆函数导数(上)- 隐函数微分
- java 定义一个方法,用于比较两个int数组的数字是否相同
- 4 anbox 树莓派_Anbox让你在Linux上“原生运行”Android应用
- 旅游流的概念_旅游流的概念界定与理论内涵新论
- python水果超市管理系统_java实现水果超市管理系统
- 律师要用到什么计算机技巧,【执业技巧】律师如何优雅地使用苹果电脑?这7款工具很有用...
- F280049C Crossbar X-BAR