社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Elasticsearch

(2/2)基于容器化,快速使用ElasticSearch

dotNET跨平台 • 3 年前 • 403 次点击  


Dev Tools, 进入后我们在左侧框中输入(先清空),输入下面的内容","marks":[]}]}],"state":{}},{"type":"block","id":"sLEX-1674208857820","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"J2vO-1674208857817","name":"code-line","data":{},"nodes":[{"type":"text","id":"TXa9-1674208857816","leaves":[{"text":"GET /","marks":[]}]}]},{"type":"block","id":"lK4S-1674208857819","name":"code-line","data":{},"nodes":[{"type":"text","id":"10qb-1674208857818","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"rnrz-1674208857822","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"OJV3-1674208857821","leaves":[{"text":"右侧栏中会出现一段json,可以看到我们的es版本等信息","marks":[]}]}],"state":{}},{"type":"block","id":"Q2NH-1674208857860","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"XEfR-1674208857824","name":"code-line","data":{},"nodes":[{"type":"text","id":"nISX-1674208857823","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"jwsl-1674208857826","name":"code-line","data":{},"nodes":[{"type":"text","id":"HfXD-1674208857825","leaves":[{"text":" \"name\": \"dae8747df6f0\",","marks":[]}]}]},{"type":"block","id":"ST1o-1674208857828","name":"code-line","data":{},"nodes":[{"type":"text","id":"Wpr3-1674208857827","leaves":[{"text":" \"cluster_name\": \"docker-cluster\",","marks":[]}]}]},{"type":"block","id":"n7Qv-1674208857831","name":"code-line","data":{},"nodes":[{"type":"text","id":"znuB-1674208857830","leaves":[{"text":" \"cluster_uuid\": \"toprRlPKRv22cMX8gh96LQ\",","marks":[]}]}]},{"type":"block","id":"h8OE-1674208857833","name":"code-line","data":{},"nodes":[{"type":"text","id":"chGL-1674208857832","leaves":[{"text":" \"version\": {","marks":[]}]}]},{"type":"block","id":"oeLR-1674208857835","name":"code-line","data":{},"nodes":[{"type":"text","id":"IZAE-1674208857834","leaves":[{"text":" \"number\": \"8.4.3\",","marks":[]}]}]},{"type":"block","id":"Qsw7-1674208857837","name":"code-line","data":{},"nodes":[{"type":"text","id":"s9H8-1674208857836","leaves":[{"text":" \"build_flavor\": \"default\",","marks":[]}]}]},{"type":"block","id":"fGpM-1674208857839","name":"code-line","data":{},"nodes":[{"type":"text","id":"73TG-1674208857838","leaves":[{"text":" \"build_type\": \"docker\",","marks":[]}]}]},{"type":"block","id":"jhxU-1674208857841","name":"code-line","data":{},"nodes":[{"type":"text","id":"gJOV-1674208857840","leaves":[{"text":" \"build_hash\": \"42f05b9372a9a4a470db3b52817899b99a76ee73\",","marks":[]}]}]},{"type":"block","id":"HDu9-1674208857843","name":"code-line","data":{},"nodes":[{"type":"text","id":"u8ZS-1674208857842","leaves":[{"text":" \"build_date\": \"2022-10-04T07:17:24.662462378Z\",","marks":[]}]}]},{"type":"block","id":"ycuU-1674208857845","name":"code-line","data":{},"nodes":[{"type":"text","id":"Yj4X-1674208857844","leaves":[{"text":" \"build_snapshot\": false,","marks":[]}]}]},{"type":"block","id":"FzRp-1674208857847","name":"code-line","data":{},"nodes":[{"type":"text","id":"RwPI-1674208857846","leaves":[{"text":" \"lucene_version\": \"9.3.0\",","marks":[]}]}]},{"type":"block","id":"ZH8o-1674208857849","name":"code-line","data":{},"nodes":[{"type":"text","id":"r4Vf-1674208857848","leaves":[{"text":" \"minimum_wire_compatibility_version\": \"7.17.0\",","marks":[]}]}]},{"type":"block","id":"JMFp-1674208857851","name":"code-line","data":{},"nodes":[{"type":"text","id":"KCj6-1674208857850","leaves":[{"text":" \"minimum_index_compatibility_version\": \"7.0.0\"","marks":[]}]}]},{"type":"block","id":"Fkow-1674208857853","name":"code-line","data":{},"nodes":[{"type":"text","id":"Lsid-1674208857852","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"ytqm-1674208857855","name":"code-line","data":{},"nodes":[{"type":"text","id":"DmDE-1674208857854","leaves":[{"text":" \"tagline\": \"You Know, for Search\"","marks":[]}]}]},{"type":"block","id":"vm7H-1674208857857","name":"code-line","data":{},"nodes":[{"type":"text","id":"oiWz-1674208857856","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"sxQk-1674208857859","name":"code-line","data":{},"nodes":[{"type":"text","id":"y8Ws-1674208857858","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"Kzno-1674208858658","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"8XEI-1674208857861","leaves":[{"text":"2、添加单个文档","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"PIsN-1674208857864","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"5CGR-1674208857863","leaves":[{"text":"提交以下索引请求以将单个日志条目添加到 logs-myapp 数据流。","marks":[]}]}],"state":{}},{"type":"block","id":"gRA4-1674208857866","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"6d2Z-1674208857865","leaves":[{"text":"由于 logs-myapp不存在,请求会使用内置的 ","marks":[]},{"text":"logs-*-*","marks":[{"type":"color","value":"#000000"},{"type":"fontSize","value":16},{"type":"fontFamily","value":"Courier New"}]},{"text":" 索引模板自动创建它。","marks":[]}]}],"state":{}},{"type":"block","id":"3WLP-1674208857868","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"bCMG-1674208857867","leaves":[{"text":"这里模拟的是一个请求的文件日志记录","marks":[]}]}],"state":{}},{"type":"block","id":"eiQU-1674208857885","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"5J6Q-1674208857870","name":"code-line","data":{},"nodes":[{"type":"text","id":"kAEO-1674208857869","leaves":[{"text":"POST logs-myapp/_doc","marks":[]}]}]},{"type":"block","id":"xMll-1674208857872","name":"code-line","data":{},"nodes":[{"type":"text","id":"01e1-1674208857871","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"bsGa-1674208857874","name":"code-line","data":{},"nodes":[{"type":"text","id":"i50U-1674208857873","leaves":[{"text":" \"@timestamp\": \"2099-05-06T16:21:15.000Z\",","marks":[]}]}]},{"type":"block","id":"XvrE-1674208857876","name":"code-line","data":{},"nodes":[{"type":"text","id":"QMYq-1674208857875","leaves":[{"text":" \"event\": {","marks":[]}]}]},{"type":"block","id":"ZbfJ-1674208857878","name":"code-line","data":{},"nodes":[{"type":"text","id":"pAC1-1674208857877","leaves":[{"text":" \"original\": \"192.0.2.42 - - [06/May/2099:16:21:15 +0000] \\\"GET /images/bg.jpg HTTP/1.0\\\" 200 24736\"","marks":[]}]}]},{"type":"block","id":"nroW-1674208857880","name":"code-line","data":{},"nodes":[{"type":"text","id":"kLny-1674208857879","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"GJ25-1674208857882","name":"code-line","data":{},"nodes":[{"type":"text","id":"55BJ-1674208857881","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"qEI4-1674208857884","name":"code-line","data":{},"nodes":[{"type":"text","id":"Vkel-1674208857883","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"LMGI-1674208857888","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"taDF-1674208857887","leaves":[{"text":"返回数据","marks":[]}]}],"state":{}},{"type":"block","id":"4Ojo-1674208857890","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"3E20-1674208857889","leaves":[{"text":"响应包括 Elasticsearch 为文档生成的元数据:","marks":[]}]}],"state":{}},{"type":"block","id":"u6C8-1674208857895","name":"list-item","data":{"version":1,"listId":"LZoR-1674208857384","listLevel":1,"listType":"unordered"},"nodes":[{"type":"text","id":"CRCk-1674208857891","leaves":[{"text":"包含文档的支持","marks":[]}]},{"type":"text","id":"dMSy-1674208857892","leaves":[{"text":" ","marks":[]}]},{"type":"text","id":"3O2i-1674208857893","leaves":[{"text":"_index","marks":[]}]},{"type":"text","id":"XL7o-1674208857894","leaves":[{"text":"。Elasticsearch 会自动生成支持索引的名称。","marks":[]}]}],"state":{"index":1}},{"type":"block","id":"wPa9-1674208857900","name":"list-item","data":{"version":1,"listId":"LZoR-1674208857384","listLevel":1,"listType":"unordered"},"nodes":[{"type":"text","id":"eC4n-1674208857896","leaves":[{"text":"索引中文档的唯一","marks":[]}]},{"type":"text","id":"6C2s-1674208857897","leaves":[{"text":" ","marks":[]}]},{"type":"text","id":"Cl7y-1674208857898","leaves":[{"text":"_id","marks":[]}]},{"type":"text","id":"j6gg-1674208857899","leaves":[{"text":"。","marks":[]}]}],"state":{"index":2}},{"type":"block","id":"aWde-1674208857929","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"MKox-1674208857902","name":"code-line","data":{},"nodes":[{"type":"text","id":"LagP-1674208857901","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"HWW9-1674208857904","name":"code-line","data":{},"nodes":[{"type":"text","id":"Kgcd-1674208857903","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"rvKK-1674208857906","name":"code-line","data":{},"nodes":[{"type":"text","id":"YUoE-1674208857905","leaves":[{"text":" \"_id\": \"snwQN4QBFZ31xH8Hlg-J\",","marks":[]}]}]},{"type":"block","id":"ZHQS-1674208857908","name":"code-line","data":{},"nodes":[{"type":"text","id":"ITNR-1674208857907","leaves":[{"text":" \"_version\": 1,","marks":[]}]}]},{"type":"block","id":"CsAY-1674208857910","name":"code-line","data":{},"nodes":[{"type":"text","id":"5v57-1674208857909","leaves":[{"text":" \"result\": \"created\",","marks":[]}]}]},{"type":"block","id":"AnKu-1674208857912","name":"code-line","data":{},"nodes":[{"type":"text","id":"8C1X-1674208857911","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"WAk7-1674208857914","name":"code-line","data":{},"nodes":[{"type":"text","id":"0UEU-1674208857913","leaves":[{"text":" \"total\": 2,","marks":[]}]}]},{"type":"block","id":"XUVX-1674208857916","name":"code-line","data":{},"nodes":[{"type":"text","id":"FtRy-1674208857915","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"G0Mg-1674208857918","name":"code-line","data":{},"nodes":[{"type":"text","id":"QX1I-1674208857917","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"6h2N-1674208857920","name":"code-line","data":{},"nodes":[{"type":"text","id":"vKtW-1674208857919","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"A8vR-1674208857922","name":"code-line","data":{},"nodes":[{"type":"text","id":"LabO-1674208857921","leaves":[{"text":" \"_seq_no\": 0,","marks":[]}]}]},{"type":"block","id":"c2h3-1674208857924","name":"code-line","data":{},"nodes":[{"type":"text","id":"vNE9-1674208857923","leaves":[{"text":" \"_primary_term\": 1","marks":[]}]}]},{"type":"block","id":"XLTg-1674208857926","name":"code-line","data":{},"nodes":[{"type":"text","id":"arsG-1674208857925","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"oVHw-1674208857928","name":"code-line","data":{},"nodes":[{"type":"text","id":"5Vre-1674208857927","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"wHVz-1674208858659","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"K8Y9-1674208857930","leaves":[{"text":"3、添加多个文档","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"fzsQ-1674208857933","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"KhrT-1674208857932","leaves":[{"text":"使用 _bulk 端点在一个请求中添加多个文档。批量数据必须是换行符分隔的 JSON (NDJSON)。每行必须以换行符 (\\n) 结尾,包括最后一行。","marks":[]}]}],"state":{}},{"type":"block","id":"P96h-1674208857946","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"xAAo-1674208857935","name":"code-line","data":{},"nodes":[{"type":"text","id":"ZrHd-1674208857934","leaves":[{"text":"PUT logs-myapp/_bulk","marks":[]}]}]},{"type":"block","id":"S3S4-1674208857937","name":"code-line","data":{},"nodes":[{"type":"text","id":"Ju2g-1674208857936","leaves":[{"text":"{ \"create\": { } }","marks":[]}]}]},{"type":"block","id":"mRLD-1674208857939","name":"code-line","data":{},"nodes":[{"type":"text","id":"m1iy-1674208857938","leaves":[{"text":"{ \"@timestamp\": \"2099-05-07T16:24:32.000Z\", \"event\": { \"original\": \"192.0.2.242 - - [07/May/2020:16:24:32 -0500] \\\"GET /images/hm_nbg.jpg HTTP/1.0\\\" 304 0\" } }","marks":[]}]}]},{"type":"block","id":"zDR6-1674208857941","name":"code-line","data":{},"nodes":[{"type":"text","id":"mIJU-1674208857940","leaves":[{"text":"{ \"create\": { } }","marks":[]}]}]},{"type":"block","id":"zrl8-1674208857943","name":"code-line","data":{},"nodes":[{"type":"text","id":"H756-1674208857942","leaves":[{"text":"{ \"@timestamp\": \"2099-05-08T16:25:42.000Z\", \"event\": { \"original\": \"192.0.2.255 - - [08/May/2099:16:25:42 +0000] \\\"GET /favicon.ico HTTP/1.0\\\" 200 3638\" } }","marks":[]}]}]},{"type":"block","id":"nKGG-1674208857945","name":"code-line","data":{},"nodes":[{"type":"text","id":"3BhB-1674208857944","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"dbM5-1674208857948","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"STwG-1674208857947","leaves":[{"text":"响应数据","marks":[]}]}],"state":{}},{"type":"block","id":"GyfQ-1674208858029","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"Fvmj-1674208857950","name":"code-line","data":{},"nodes":[{"type":"text","id":"77w7-1674208857949","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"rSqd-1674208857952","name":"code-line","data":{},"nodes":[{"type":"text","id":"pnpr-1674208857951","leaves":[{"text":" \"took\": 28,","marks":[]}]}]},{"type":"block","id":"bMud-1674208857955","name":"code-line","data":{},"nodes":[{"type":"text","id":"sf2P-1674208857954","leaves":[{"text":" \"errors\": false,","marks":[]}]}]},{"type":"block","id":"iZpH-1674208857957","name":"code-line","data":{},"nodes":[{"type":"text","id":"9Oen-1674208857956","leaves":[{"text":" \"items\": [","marks":[]}]}]},{"type":"block","id":"nTKk-1674208857959","name":"code-line","data":{},"nodes":[{"type":"text","id":"pkOR-1674208857958","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"Bk1p-1674208857961","name":"code-line","data":{},"nodes":[{"type":"text","id":"EjC0-1674208857960","leaves":[{"text":" \"create\": {","marks":[]}]}]},{"type":"block","id":"UJ1M-1674208857963","name":"code-line","data":{},"nodes":[{"type":"text","id":"Vemw-1674208857962","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"iocp-1674208857965","name":"code-line","data":{},"nodes":[{"type":"text","id":"Eiz8-1674208857964","leaves":[{"text":" \"_id\": \"s3wVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"huYe-1674208857967","name":"code-line","data":{},"nodes":[{"type":"text","id":"8fa9-1674208857966","leaves":[{"text":" \"_version\": 1,","marks":[]}]}]},{"type":"block","id":"Z13v-1674208857969","name":"code-line","data":{},"nodes":[{"type":"text","id":"lK7a-1674208857968","leaves":[{"text":" \"result\": \"created\",","marks":[]}]}]},{"type":"block","id":"sgUg-1674208857971","name":"code-line","data":{},"nodes":[{"type":"text","id":"5CIw-1674208857970","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"yKVT-1674208857973","name":"code-line","data":{},"nodes":[{"type":"text","id":"uBTK-1674208857972","leaves":[{"text":" \"total\": 2,","marks":[]}]}]},{"type":"block","id":"1Unj-1674208857975","name":"code-line","data":{},"nodes":[{"type":"text","id":"BlWM-1674208857974","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"b1js-1674208857977","name":"code-line","data":{},"nodes":[{"type":"text","id":"8684-1674208857976","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"oWha-1674208857979","name":"code-line","data":{},"nodes":[{"type":"text","id":"rqWJ-1674208857978","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"RKMS-1674208857981","name":"code-line","data":{},"nodes":[{"type":"text","id":"J387-1674208857980","leaves":[{"text":" \"_seq_no\": 1,","marks":[]}]}]},{"type":"block","id":"nivM-1674208857983","name":"code-line","data":{},"nodes":[{"type":"text","id":"DaRJ-1674208857982","leaves":[{"text":" \"_primary_term\": 1,","marks":[]}]}]},{"type":"block","id":"5J5s-1674208857985","name":"code-line","data":{},"nodes":[{"type":"text","id":"l7le-1674208857984","leaves":[{"text":" \"status\": 201","marks":[]}]}]},{"type":"block","id":"RB1t-1674208857987","name":"code-line","data":{},"nodes":[{"type":"text","id":"YRRe-1674208857986","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"IlR4-1674208857989","name":"code-line","data":{},"nodes":[{"type":"text","id":"FHyz-1674208857988","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"xW2L-1674208857991","name":"code-line","data":{},"nodes":[{"type":"text","id":"byfE-1674208857990","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"rtoM-1674208857993","name":"code-line","data":{},"nodes":[{"type":"text","id":"5Xi5-1674208857992","leaves":[{"text":" \"create\": {","marks":[]}]}]},{"type":"block","id":"LnPW-1674208857995","name":"code-line","data":{},"nodes":[{"type":"text","id":"kXLn-1674208857994","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"zMCE-1674208857997","name":"code-line","data":{},"nodes":[{"type":"text","id":"WeO8-1674208857996","leaves":[{"text":" \"_id\": \"tHwVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"ckQv-1674208857999","name":"code-line","data":{},"nodes":[{"type":"text","id":"MjSt-1674208857998","leaves":[{"text":" \"_version\": 1,","marks":[]}]}]},{"type":"block","id":"kx5x-1674208858001","name":"code-line","data":{},"nodes":[{"type":"text","id":"6HFE-1674208858000","leaves":[{"text":" \"result\": \"created\",","marks":[]}]}]},{"type":"block","id":"Hwqz-1674208858003","name":"code-line","data":{},"nodes":[{"type":"text","id":"JxiB-1674208858002","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"FMUa-1674208858005","name":"code-line","data":{},"nodes":[{"type":"text","id":"dmUK-1674208858004","leaves":[{"text":" \"total\": 2,","marks":[]}]}]},{"type":"block","id":"b4qq-1674208858007","name":"code-line","data":{},"nodes":[{"type":"text","id":"6WbT-1674208858006","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"Mk0Q-1674208858009","name":"code-line","data":{},"nodes":[{"type":"text","id":"dTnC-1674208858008","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"4THu-1674208858011","name":"code-line","data":{},"nodes":[{"type":"text","id":"lRvS-1674208858010","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"bFQk-1674208858013","name":"code-line","data":{},"nodes":[{"type":"text","id":"XYVN-1674208858012","leaves":[{"text":" \"_seq_no\": 2,","marks":[]}]}]},{"type":"block","id":"uNsL-1674208858015","name":"code-line","data":{},"nodes":[{"type":"text","id":"WAgM-1674208858014","leaves":[{"text":" \"_primary_term\": 1,","marks":[]}]}]},{"type":"block","id":"76cf-1674208858017","name":"code-line","data":{},"nodes":[{"type":"text","id":"mjg9-1674208858016","leaves":[{"text":" \"status\": 201","marks":[]}]}]},{"type":"block","id":"zKhS-1674208858019","name":"code-line","data":{},"nodes":[{"type":"text","id":"Ivc2-1674208858018","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"XCX0-1674208858021","name":"code-line","data":{},"nodes":[{"type":"text","id":"ccDy-1674208858020","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"kEU9-1674208858023","name":"code-line","data":{},"nodes":[{"type":"text","id":"GEjR-1674208858022","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"wNQ9-1674208858025","name":"code-line","data":{},"nodes":[{"type":"text","id":"LPFG-1674208858024","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"zieO-1674208858027","name":"code-line","data":{},"nodes":[{"type":"text","id":"jxzR-1674208858026","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"SK4r-1674208858660","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"w9gA-1674208858030","leaves":[{"text":"4、查看当前索引","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"HaDh-1674208858036","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"urDN-1674208858033","name":"code-line","data":{},"nodes":[{"type":"text","id":"aaUR-1674208858032","leaves":[{"text":"GET _cat/indices","marks":[]}]}]},{"type":"block","id":"Rp25-1674208858035","name":"code-line","data":{},"nodes":[{"type":"text","id":"I4tX-1674208858034","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"qIpP-1674208858661","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"Rb5I-1674208858037","leaves":[{"text":"5、搜索文档内容","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"CxJP-1674208858040","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"FJuK-1674208858039","leaves":[{"text":"查询条件为所有条目,","marks":[]}]}],"state":{}},{"type":"block","id":"Tr1Q-1674208858042","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"HmzZ-1674208858041","leaves":[{"text":"按字段@timestamp降序排列","marks":[]}]}],"state":{}},{"type":"block","id":"jd8f-1674208858071","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"fEX6-1674208858044","name":"code-line","data":{},"nodes":[{"type":"text","id":"wBvi-1674208858043","leaves":[{"text":"GET logs-myapp/_search","marks":[]}]}]},{"type":"block","id":"YD8F-1674208858046","name":"code-line","data":{},"nodes":[{"type":"text","id":"H7IU-1674208858045","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"NRsJ-1674208858048","name":"code-line","data":{},"nodes":[{"type":"text","id":"ISMG-1674208858047","leaves":[{"text":" \"query\": {","marks":[]}]}]},{"type":"block","id":"zCDn-1674208858050","name":"code-line","data":{},"nodes":[{"type":"text","id":"pf3k-1674208858049","leaves":[{"text":" \"match_all\": {}","marks":[]}]}]},{"type":"block","id":"lILV-1674208858052","name":"code-line","data":{},"nodes":[{"type":"text","id":"bMo4-1674208858051","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"as4X-1674208858054","name":"code-line","data":{},"nodes":[{"type":"text","id":"bfEM-1674208858053","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"09V4-1674208858056","name":"code-line","data":{},"nodes":[{"type":"text","id":"WkFI-1674208858055","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"nQkM-1674208858058","name":"code-line","data":{},"nodes":[{"type":"text","id":"AeuA-1674208858057","leaves":[{"text":" \"@timestamp\": {","marks":[]}]}]},{"type":"block","id":"Rwxm-1674208858060","name":"code-line","data":{},"nodes":[{"type":"text","id":"Vl1Q-1674208858059","leaves":[{"text":" \"order\": \"desc\"","marks":[]}]}]},{"type":"block","id":"wVQn-1674208858062","name":"code-line","data":{},"nodes":[{"type":"text","id":"u0lo-1674208858061","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"a6xa-1674208858064","name":"code-line","data":{},"nodes":[{"type":"text","id":"DxkT-1674208858063","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"b43g-1674208858066","name":"code-line","data":{},"nodes":[{"type":"text","id":"1zTf-1674208858065","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"4S1P-1674208858068","name":"code-line","data":{},"nodes":[{"type":"text","id":"IQrG-1674208858067","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"BEIr-1674208858070","name":"code-line","data":{},"nodes":[{"type":"text","id":"fUKM-1674208858069","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"Caw9-1674208858073","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"TjtV-1674208858072","leaves":[{"text":"返回结果","marks":[]}]}],"state":{}},{"type":"block","id":"JECT-1674208858200","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"pnnx-1674208858075","name":"code-line","data":{},"nodes":[{"type":"text","id":"l9M7-1674208858074","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"w4QA-1674208858077","name":"code-line","data":{},"nodes":[{"type":"text","id":"6Hby-1674208858076","leaves":[{"text":" \"took\": 0,","marks":[]}]}]},{"type":"block","id":"zHR9-1674208858079","name":"code-line","data":{},"nodes":[{"type":"text","id":"BoGA-1674208858078","leaves":[{"text":" \"timed_out\": false,","marks":[]}]}]},{"type":"block","id":"FU9l-1674208858081","name":"code-line","data":{},"nodes":[{"type":"text","id":"zwar-1674208858080","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"9ynH-1674208858083","name":"code-line","data":{},"nodes":[{"type":"text","id":"LeBU-1674208858082","leaves":[{"text":" \"total\": 1,","marks":[]}]}]},{"type":"block","id":"TzPn-1674208858085","name":"code-line","data":{},"nodes":[{"type":"text","id":"nggU-1674208858084","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"2I4R-1674208858087","name":"code-line","data":{},"nodes":[{"type":"text","id":"hoCz-1674208858086","leaves":[{"text":" \"skipped\": 0,","marks":[]}]}]},{"type":"block","id":"GjgI-1674208858089","name":"code-line","data":{},"nodes":[{"type":"text","id":"8vqi-1674208858088","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"2KUH-1674208858091","name":"code-line","data":{},"nodes":[{"type":"text","id":"yDNQ-1674208858090","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"sTVb-1674208858093","name":"code-line","data":{},"nodes":[{"type":"text","id":"8cJf-1674208858092","leaves":[{"text":" \"hits\": {","marks":[]}]}]},{"type":"block","id":"HUjL-1674208858095","name":"code-line","data":{},"nodes":[{"type":"text","id":"W2y1-1674208858094","leaves":[{"text":" \"total\": {","marks":[]}]}]},{"type":"block","id":"UN3u-1674208858097","name":"code-line","data":{},"nodes":[{"type":"text","id":"zfoJ-1674208858096","leaves":[{"text":" \"value\": 3,","marks":[]}]}]},{"type":"block","id":"R6GY-1674208858099","name":"code-line","data":{},"nodes":[{"type":"text","id":"SYfI-1674208858098","leaves":[{"text":" \"relation\": \"eq\"","marks":[]}]}]},{"type":"block","id":"zd65-1674208858102","name":"code-line","data":{},"nodes":[{"type":"text","id":"1rhr-1674208858100","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"1CSh-1674208858104","name":"code-line","data":{},"nodes":[{"type":"text","id":"XbMX-1674208858103","leaves":[{"text":" \"max_score\": null,","marks":[]}]}]},{"type":"block","id":"ksqD-1674208858106","name":"code-line","data":{},"nodes":[{"type":"text","id":"1oID-1674208858105","leaves":[{"text":" \"hits\": [","marks":[]}]}]},{"type":"block","id":"WLFn-1674208858108","name":"code-line","data":{},"nodes":[{"type":"text","id":"NYMX-1674208858107","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"ktUs-1674208858110","name":"code-line","data":{},"nodes":[{"type":"text","id":"vPuc-1674208858109","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"22ZY-1674208858112","name":"code-line","data":{},"nodes":[{"type":"text","id":"rY1e-1674208858111","leaves":[{"text":" \"_id\": \"tHwVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"gFoO-1674208858114","name":"code-line","data":{},"nodes":[{"type":"text","id":"Q2VH-1674208858113","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"oHs4-1674208858116","name":"code-line","data":{},"nodes":[{"type":"text","id":"2iUm-1674208858115","leaves":[{"text":" \"_source\": {","marks":[]}]}]},{"type":"block","id":"nWQt-1674208858118","name":"code-line","data":{},"nodes":[{"type":"text","id":"lXNm-1674208858117","leaves":[{"text":" \"@timestamp\": \"2099-05-08T16:25:42.000Z\",","marks":[]}]}]},{"type":"block","id":"V24F-1674208858120","name":"code-line","data":{},"nodes":[{"type":"text","id":"zWdB-1674208858119","leaves":[{"text":" \"event\": {","marks":[]}]}]},{"type":"block","id":"KYoA-1674208858122","name":"code-line","data":{},"nodes":[{"type":"text","id":"FLgt-1674208858121","leaves":[{"text":" \"original\": \"\"\"192.0.2.255 - - [08/May/2099:16:25:42 +0000] \"GET /favicon.ico HTTP/1.0\" 200 3638\"\"\"","marks":[]}]}]},{"type":"block","id":"Of6v-1674208858124","name":"code-line","data":{},"nodes":[{"type":"text","id":"1jp6-1674208858123","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"9f9I-1674208858126","name":"code-line","data":{},"nodes":[{"type":"text","id":"Dv2T-1674208858125","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"iYld-1674208858128","name":"code-line","data":{},"nodes":[{"type":"text","id":"6678-1674208858127","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"gPbB-1674208858130","name":"code-line","data":{},"nodes":[{"type":"text","id":"b3Ye-1674208858129","leaves":[{"text":" 4081940742000","marks":[]}]}]},{"type":"block","id":"ezPk-1674208858132","name":"code-line","data":{},"nodes":[{"type":"text","id":"cMVE-1674208858131","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"vQZY-1674208858134","name":"code-line","data":{},"nodes":[{"type":"text","id":"8mpv-1674208858133","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"wcEV-1674208858136","name":"code-line","data":{},"nodes":[{"type":"text","id":"9L2z-1674208858135","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"gGFZ-1674208858139","name":"code-line","data":{},"nodes":[{"type":"text","id":"JHPA-1674208858138","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"yt5I-1674208858141","name":"code-line","data":{},"nodes":[{"type":"text","id":"AZEj-1674208858140","leaves":[{"text":" \"_id\": \"s3wVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"KtF3-1674208858143","name":"code-line","data":{},"nodes":[{"type":"text","id":"6x80-1674208858142","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"H49q-1674208858145","name":"code-line","data":{},"nodes":[{"type":"text","id":"xNZ3-1674208858144","leaves":[{"text":" \"_source\": {","marks":[]}]}]},{"type":"block","id":"9tb8-1674208858147","name":"code-line","data":{},"nodes":[{"type":"text","id":"NkSH-1674208858146","leaves":[{"text":" \"@timestamp\": \"2099-05-07T16:24:32.000Z\",","marks":[]}]}]},{"type":"block","id":"IuGC-1674208858149","name":"code-line","data":{},"nodes":[{"type":"text","id":"UGNr-1674208858148","leaves":[{"text":" \"event\": {","marks":[]}]}]},{"type":"block","id":"ie0W-1674208858151","name":"code-line","data":{},"nodes":[{"type":"text","id":"odqk-1674208858150","leaves":[{"text":" \"original\": \"\"\"192.0.2.242 - - [07/May/2020:16:24:32 -0500] \"GET /images/hm_nbg.jpg HTTP/1.0\" 304 0\"\"\"","marks":[]}]}]},{"type":"block","id":"ZTV5-1674208858153","name":"code-line","data":{},"nodes":[{"type":"text","id":"e3eK-1674208858152","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"FiDw-1674208858155","name":"code-line","data":{},"nodes":[{"type":"text","id":"xoD0-1674208858154","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"Hl5N-1674208858157","name":"code-line","data":{},"nodes":[{"type":"text","id":"gSpz-1674208858156","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"xjCc-1674208858159","name":"code-line","data":{},"nodes":[{"type":"text","id":"O9SS-1674208858158","leaves":[{"text":" 4081854272000","marks":[]}]}]},{"type":"block","id":"8Fgg-1674208858161","name":"code-line","data":{},"nodes":[{"type":"text","id":"dS3r-1674208858160","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"V0y2-1674208858163","name":"code-line","data":{},"nodes":[{"type":"text","id":"IBWI-1674208858162","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"5vZf-1674208858165","name":"code-line","data":{},"nodes":[{"type":"text","id":"FGk7-1674208858164","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"5RuD-1674208858167","name":"code-line","data":{},"nodes":[{"type":"text","id":"x5VX-1674208858166","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"1Eav-1674208858169","name":"code-line","data":{},"nodes":[{"type":"text","id":"7BDH-1674208858168","leaves":[{"text":" \"_id\": \"snwQN4QBFZ31xH8Hlg-J\",","marks":[]}]}]},{"type":"block","id":"4WAJ-1674208858171","name":"code-line","data":{},"nodes":[{"type":"text","id":"NKj7-1674208858170","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"5oAI-1674208858173","name":"code-line","data":{},"nodes":[{"type":"text","id":"cHA5-1674208858172","leaves":[{"text":" \"_source\": {","marks":[]}]}]},{"type":"block","id":"fMyF-1674208858175","name":"code-line","data":{},"nodes":[{"type":"text","id":"jtXn-1674208858174","leaves":[{"text":" \"@timestamp\": \"2099-05-06T16:21:15.000Z\",","marks":[]}]}]},{"type":"block","id":"mL9D-1674208858177","name":"code-line","data":{},"nodes":[{"type":"text","id":"jnX7-1674208858176","leaves":[{"text":" \"event\": {","marks":[]}]}]},{"type":"block","id":"bngq-1674208858179","name":"code-line","data":{},"nodes":[{"type":"text","id":"DZIY-1674208858178","leaves":[{"text":" \"original\": \"\"\"192.0.2.42 - - [06/May/2099:16:21:15 +0000] \"GET /images/bg.jpg HTTP/1.0\" 200 24736\"\"\"","marks":[]}]}]},{"type":"block","id":"W59Z-1674208858181","name":"code-line","data":{},"nodes":[{"type":"text","id":"LR8x-1674208858180","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"YYi1-1674208858183","name":"code-line","data":{},"nodes":[{"type":"text","id":"3N43-1674208858182","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"uiUm-1674208858185","name":"code-line","data":{},"nodes":[{"type":"text","id":"VVMp-1674208858184","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"Ax1M-1674208858187","name":"code-line","data":{},"nodes":[{"type":"text","id":"TQbk-1674208858186","leaves":[{"text":" 4081767675000","marks":[]}]}]},{"type":"block","id":"7FPy-1674208858189","name":"code-line","data":{},"nodes":[{"type":"text","id":"SbA3-1674208858188","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"EnQP-1674208858191","name":"code-line","data":{},"nodes":[{"type":"text","id":"maam-1674208858190","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"Y1WP-1674208858193","name":"code-line","data":{},"nodes":[{"type":"text","id":"nyCK-1674208858192","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"z3sW-1674208858195","name":"code-line","data":{},"nodes":[{"type":"text","id":"8ANm-1674208858194","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"SoQz-1674208858197","name":"code-line","data":{},"nodes":[{"type":"text","id":"5zfg-1674208858196","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"Jb43-1674208858199","name":"code-line","data":{},"nodes":[{"type":"text","id":"67aZ-1674208858198","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"N5HO-1674208858662","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"rX21-1674208858201","leaves":[{"text":"6、搜索文档内容-特定字段","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"xiDn-1674208858204","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"dcRs-1674208858203","leaves":[{"text":"对于大文档,解析整个_source很麻烦,","marks":[]}]}],"state":{}},{"type":"block","id":"hOuH-1674208858206","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"x7uv-1674208858205","leaves":[{"text":"我们需要将_source参数置为false。","marks":[]}]}],"state":{}},{"type":"block","id":"Ul0f-1674208858208","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"2EzC-1674208858207","leaves":[{"text":"然后从fields参数中来检索想要的字段","marks":[]}]}],"state":{}},{"type":"block","id":"eDUN-1674208858246","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"qmUE-1674208858210","name":"code-line","data":{},"nodes":[{"type":"text","id":"2eQr-1674208858209","leaves":[{"text":"GET logs-myapp/_search","marks":[]}]}]},{"type":"block","id":"dYKR-1674208858213","name":"code-line","data":{},"nodes":[{"type":"text","id":"sfV3-1674208858212","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"zRwU-1674208858215","name":"code-line","data":{},"nodes":[{"type":"text","id":"RBg5-1674208858214","leaves":[{"text":" \"query\": {","marks":[]}]}]},{"type":"block","id":"Yrwq-1674208858217","name":"code-line","data":{},"nodes":[{"type":"text","id":"LfkE-1674208858216","leaves":[{"text":" \"match_all\": {}","marks":[]}]}]},{"type":"block","id":"9OpU-1674208858219","name":"code-line","data":{},"nodes":[{"type":"text","id":"bLN1-1674208858218","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"R9fd-1674208858221","name":"code-line","data":{},"nodes":[{"type":"text","id":"Bmff-1674208858220","leaves":[{"text":" \"fields\": [","marks":[]}]}]},{"type":"block","id":"zJpH-1674208858223","name":"code-line","data":{},"nodes":[{"type":"text","id":"gZme-1674208858222","leaves":[{"text":" \"@timestamp\"","marks":[]}]}]},{"type":"block","id":"USj8-1674208858225","name":"code-line","data":{},"nodes":[{"type":"text","id":"GEeA-1674208858224","leaves":[{"text":" ],","marks":[]}]}]},{"type":"block","id":"9Rsd-1674208858227","name":"code-line","data":{},"nodes":[{"type":"text","id":"uflW-1674208858226","leaves":[{"text":" \"_source\": false,","marks":[]}]}]},{"type":"block","id":"XjQO-1674208858229","name":"code-line","data":{},"nodes":[{"type":"text","id":"mQXQ-1674208858228","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"jW61-1674208858231","name":"code-line","data":{},"nodes":[{"type":"text","id":"Af0C-1674208858230","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"BtP8-1674208858233","name":"code-line","data":{},"nodes":[{"type":"text","id":"xkjY-1674208858232","leaves":[{"text":" \"@timestamp\": {","marks":[]}]}]},{"type":"block","id":"qxQr-1674208858235","name":"code-line","data":{},"nodes":[{"type":"text","id":"u5lC-1674208858234","leaves":[{"text":" \"order\": \"desc\"","marks":[]}]}]},{"type":"block","id":"s0cP-1674208858237","name":"code-line","data":{},"nodes":[{"type":"text","id":"wcIB-1674208858236","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"amjE-1674208858239","name":"code-line","data":{},"nodes":[{"type":"text","id":"WLD7-1674208858238","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"nbrd-1674208858241","name":"code-line","data":{},"nodes":[{"type":"text","id":"JFjd-1674208858240","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"jaSJ-1674208858243","name":"code-line","data":{},"nodes":[{"type":"text","id":"Ix9S-1674208858242","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"mGIK-1674208858245","name":"code-line","data":{},"nodes":[{"type":"text","id":"yY29-1674208858244","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"QjaS-1674208858248","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"nuyI-1674208858247","leaves":[{"text":"响应数据","marks":[]}]}],"state":{}},{"type":"block","id":"fc8v-1674208858369","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"LxGH-1674208858250","name":"code-line","data":{},"nodes":[{"type":"text","id":"FidM-1674208858249","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"Ag1i-1674208858252","name":"code-line","data":{},"nodes":[{"type":"text","id":"PWG7-1674208858251","leaves":[{"text":" \"took\": 0,","marks":[]}]}]},{"type":"block","id":"ZggU-1674208858254","name":"code-line","data":{},"nodes":[{"type":"text","id":"fYnR-1674208858253","leaves":[{"text":" \"timed_out\": false,","marks":[]}]}]},{"type":"block","id":"dCNn-1674208858256","name":"code-line","data":{},"nodes":[{"type":"text","id":"5xIB-1674208858255","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"iPlD-1674208858258","name":"code-line","data":{},"nodes":[{"type":"text","id":"G96S-1674208858257","leaves":[{"text":" \"total\": 1,","marks":[]}]}]},{"type":"block","id":"oLW8-1674208858260","name":"code-line","data":{},"nodes":[{"type":"text","id":"WK5I-1674208858259","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"3rID-1674208858262","name":"code-line","data":{},"nodes":[{"type":"text","id":"xiBQ-1674208858261","leaves":[{"text":" \"skipped\": 0,","marks":[]}]}]},{"type":"block","id":"VcK3-1674208858264","name":"code-line","data":{},"nodes":[{"type":"text","id":"DBGa-1674208858263","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"CQ7Y-1674208858266","name":"code-line","data":{},"nodes":[{"type":"text","id":"1r9B-1674208858265","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"7KXE-1674208858268","name":"code-line","data":{},"nodes":[{"type":"text","id":"y0hA-1674208858267","leaves":[{"text":" \"hits\": {","marks":[]}]}]},{"type":"block","id":"XJ5F-1674208858271","name":"code-line","data":{},"nodes":[{"type":"text","id":"geE8-1674208858270","leaves":[{"text":" \"total\": {","marks":[]}]}]},{"type":"block","id":"x1f9-1674208858273","name":"code-line","data":{},"nodes":[{"type":"text","id":"tx5p-1674208858272","leaves":[{"text":" \"value\": 3,","marks":[]}]}]},{"type":"block","id":"Uyxy-1674208858275","name":"code-line","data":{},"nodes":[{"type":"text","id":"tXo5-1674208858274","leaves":[{"text":" \"relation\": \"eq\"","marks":[]}]}]},{"type":"block","id":"wTH7-1674208858277","name":"code-line","data":{},"nodes":[{"type":"text","id":"XL6z-1674208858276","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"oAqN-1674208858279","name":"code-line","data":{},"nodes":[{"type":"text","id":"kAXC-1674208858278","leaves":[{"text":" \"max_score\": null,","marks":[]}]}]},{"type":"block","id":"4tTB-1674208858281","name":"code-line","data":{},"nodes":[{"type":"text","id":"8idT-1674208858280","leaves":[{"text":" \"hits\": [","marks":[]}]}]},{"type":"block","id":"PHpw-1674208858283","name":"code-line","data":{},"nodes":[{"type":"text","id":"fLkB-1674208858282","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"Z3Qs-1674208858285","name":"code-line","data":{},"nodes":[{"type":"text","id":"K4JX-1674208858284","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"cPWG-1674208858287","name":"code-line","data":{},"nodes":[{"type":"text","id":"t0GX-1674208858286","leaves":[{"text":" \"_id\": \"tHwVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"NWiK-1674208858289","name":"code-line","data":{},"nodes":[{"type":"text","id":"SHhN-1674208858288","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"dsKp-1674208858291","name":"code-line","data":{},"nodes":[{"type":"text","id":"ce4m-1674208858290","leaves":[{"text":" \"fields\": {","marks":[]}]}]},{"type":"block","id":"1IaO-1674208858293","name":"code-line","data":{},"nodes":[{"type":"text","id":"DMbS-1674208858292","leaves":[{"text":" \"@timestamp\": [","marks":[]}]}]},{"type":"block","id":"DHJH-1674208858295","name":"code-line","data":{},"nodes":[{"type":"text","id":"RE97-1674208858294","leaves":[{"text":" \"2099-05-08T16:25:42.000Z\"","marks":[]}]}]},{"type":"block","id":"MkjV-1674208858297","name":"code-line","data":{},"nodes":[{"type":"text","id":"lzpL-1674208858296","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"rbb8-1674208858299","name":"code-line","data":{},"nodes":[{"type":"text","id":"8ndw-1674208858298","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"EzlI-1674208858301","name":"code-line","data":{},"nodes":[{"type":"text","id":"APpn-1674208858300","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"jlK9-1674208858303","name":"code-line","data":{},"nodes":[{"type":"text","id":"j2f3-1674208858302","leaves":[{"text":" 4081940742000","marks":[]}]}]},{"type":"block","id":"f0LX-1674208858305","name":"code-line","data":{},"nodes":[{"type":"text","id":"nzyr-1674208858304","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"sxeN-1674208858307","name":"code-line","data":{},"nodes":[{"type":"text","id":"pNpL-1674208858306","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"JYNV-1674208858309","name":"code-line","data":{},"nodes":[{"type":"text","id":"717G-1674208858308","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"9RET-1674208858311","name":"code-line","data":{},"nodes":[{"type":"text","id":"Lug3-1674208858310","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"6LBL-1674208858313","name":"code-line","data":{},"nodes":[{"type":"text","id":"D9bB-1674208858312","leaves":[{"text":" \"_id\": \"s3wVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"2Z1L-1674208858315","name":"code-line","data":{},"nodes":[{"type":"text","id":"7yly-1674208858314","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"JjCm-1674208858317","name":"code-line","data":{},"nodes":[{"type":"text","id":"wA39-1674208858316","leaves":[{"text":" \"fields\": {","marks":[]}]}]},{"type":"block","id":"vIiB-1674208858319","name":"code-line","data":{},"nodes":[{"type":"text","id":"lfMs-1674208858318","leaves":[{"text":" \"@timestamp\": [","marks":[]}]}]},{"type":"block","id":"DnpX-1674208858321","name":"code-line","data":{},"nodes":[{"type":"text","id":"WIKa-1674208858320","leaves":[{"text":" \"2099-05-07T16:24:32.000Z\"","marks":[]}]}]},{"type":"block","id":"Zkl9-1674208858323","name":"code-line","data":{},"nodes":[{"type":"text","id":"KqsT-1674208858322","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"TN7m-1674208858325","name":"code-line","data":{},"nodes":[{"type":"text","id":"tbUD-1674208858324","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"n98B-1674208858327","name":"code-line","data":{},"nodes":[{"type":"text","id":"31z6-1674208858326","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"FPvX-1674208858329","name":"code-line","data":{},"nodes":[{"type":"text","id":"6Jyd-1674208858328","leaves":[{"text":" 4081854272000","marks":[]}]}]},{"type":"block","id":"dcSv-1674208858331","name":"code-line","data":{},"nodes":[{"type":"text","id":"zl0F-1674208858330","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"Ku90-1674208858333","name":"code-line","data":{},"nodes":[{"type":"text","id":"3DkB-1674208858332","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"qJ0V-1674208858335","name":"code-line","data":{},"nodes":[{"type":"text","id":"iZPN-1674208858334","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"JlR1-1674208858338","name":"code-line","data":{},"nodes":[{"type":"text","id":"eFeG-1674208858337","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"Lsii-1674208858340","name":"code-line","data":{},"nodes":[{"type":"text","id":"cdrv-1674208858339","leaves":[{"text":" \"_id\": \"snwQN4QBFZ31xH8Hlg-J\",","marks":[]}]}]},{"type":"block","id":"0lyV-1674208858342","name":"code-line","data":{},"nodes":[{"type":"text","id":"nkZD-1674208858341","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"NXNW-1674208858344","name":"code-line","data":{},"nodes":[{"type":"text","id":"EIPf-1674208858343","leaves":[{"text":" \"fields\": {","marks":[]}]}]},{"type":"block","id":"hOek-1674208858346","name":"code-line","data":{},"nodes":[{"type":"text","id":"TJWo-1674208858345","leaves":[{"text":" \"@timestamp\": [","marks":[]}]}]},{"type":"block","id":"RGdm-1674208858348","name":"code-line","data":{},"nodes":[{"type":"text","id":"Ngiu-1674208858347","leaves":[{"text":" \"2099-05-06T16:21:15.000Z\"","marks":[]}]}]},{"type":"block","id":"BSJw-1674208858350","name":"code-line","data":{},"nodes":[{"type":"text","id":"oz7g-1674208858349","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"KVEA-1674208858352","name":"code-line","data":{},"nodes":[{"type":"text","id":"hKpl-1674208858351","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"9ZNI-1674208858354","name":"code-line","data":{},"nodes":[{"type":"text","id":"mTBA-1674208858353","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"6q4w-1674208858356","name":"code-line","data":{},"nodes":[{"type":"text","id":"iZEa-1674208858355","leaves":[{"text":" 4081767675000","marks":[]}]}]},{"type":"block","id":"q0tb-1674208858358","name":"code-line","data":{},"nodes":[{"type":"text","id":"2PR2-1674208858357","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"uqBq-1674208858360","name":"code-line","data":{},"nodes":[{"type":"text","id":"IOj8-1674208858359","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"Sxn1-1674208858362","name":"code-line","data":{},"nodes":[{"type":"text","id":"Tiod-1674208858361","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"oaqy-1674208858364","name":"code-line","data":{},"nodes":[{"type":"text","id":"Swkd-1674208858363","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"I9d4-1674208858366","name":"code-line","data":{},"nodes":[{"type":"text","id":"C2oA-1674208858365","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"JkWM-1674208858368","name":"code-line","data":{},"nodes":[{"type":"text","id":"KnsF-1674208858367","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"3ngH-1674208858664","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"dOni-1674208858370","leaves":[{"text":"7、搜索文档内容-查询范围","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"GJRP-1674208858373","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"5JMA-1674208858372","leaves":[{"text":"在特定的时间或者IP范围内进行搜索","marks":[]}]}],"state":{}},{"type":"block","id":"LsIH-1674208858421","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"4H7q-1674208858375","name":"code-line","data":{},"nodes":[{"type":"text","id":"vITX-1674208858374","leaves":[{"text":"GET logs-myapp/_search","marks":[]}]}]},{"type":"block","id":"rRhm-1674208858377","name":"code-line","data":{},"nodes":[{"type":"text","id":"HoDD-1674208858376","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"eEWE-1674208858379","name":"code-line","data":{},"nodes":[{"type":"text","id":"VeeA-1674208858378","leaves":[{"text":" \"query\": {","marks":[]}]}]},{"type":"block","id":"99g8-1674208858381","name":"code-line","data":{},"nodes":[{"type":"text","id":"4QaX-1674208858380","leaves":[{"text":" \"range\": {","marks":[]}]}]},{"type":"block","id":"2wQn-1674208858383","name":"code-line","data":{},"nodes":[{"type":"text","id":"zrJ2-1674208858382","leaves":[{"text":" \"@timestamp\": {","marks":[]}]}]},{"type":"block","id":"SuOd-1674208858385","name":"code-line","data":{},"nodes":[{"type":"text","id":"E4pB-1674208858384","leaves":[{"text":" \"gte\": \"2099-05-07\",","marks":[]}]}]},{"type":"block","id":"D1KZ-1674208858387","name":"code-line","data":{},"nodes":[{"type":"text","id":"JD4Z-1674208858386","leaves":[{"text":" \"lte\": \"2099-05-08\"","marks":[]}]}]},{"type":"block","id":"BWHh-1674208858389","name":"code-line","data":{},"nodes":[{"type":"text","id":"D0Sy-1674208858388","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"vOPm-1674208858391","name":"code-line","data":{},"nodes":[{"type":"text","id":"9sDs-1674208858390","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"HqjH-1674208858393","name":"code-line","data":{},"nodes":[{"type":"text","id":"eIfY-1674208858392","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"JPoA-1674208858395","name":"code-line","data":{},"nodes":[{"type":"text","id":"Dhdq-1674208858394","leaves":[{"text":" \"fields\": [","marks":[]}]}]},{"type":"block","id":"W4j8-1674208858397","name":"code-line","data":{},"nodes":[{"type":"text","id":"FyQ6-1674208858396","leaves":[{"text":" \"@timestamp\"","marks":[]}]}]},{"type":"block","id":"04A4-1674208858399","name":"code-line","data":{},"nodes":[{"type":"text","id":"oXTR-1674208858398","leaves":[{"text":" ],","marks":[]}]}]},{"type":"block","id":"qWct-1674208858401","name":"code-line","data":{},"nodes":[{"type":"text","id":"Aa4c-1674208858400","leaves":[{"text":" \"_source\": false,","marks":[]}]}]},{"type":"block","id":"6ssM-1674208858403","name":"code-line","data":{},"nodes":[{"type":"text","id":"DQ3u-1674208858402","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"EqrZ-1674208858405","name":"code-line","data":{},"nodes":[{"type":"text","id":"E65i-1674208858404","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"KJ9H-1674208858407","name":"code-line","data":{},"nodes":[{"type":"text","id":"7AjN-1674208858406","leaves":[{"text":" \"@timestamp\": {","marks":[]}]}]},{"type":"block","id":"bzUE-1674208858409","name":"code-line","data":{},"nodes":[{"type":"text","id":"QBS6-1674208858408","leaves":[{"text":" \"order\": \"desc\"","marks":[]}]}]},{"type":"block","id":"AxiV-1674208858412","name":"code-line","data":{},"nodes":[{"type":"text","id":"aiFM-1674208858411","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"IsFu-1674208858414","name":"code-line","data":{},"nodes":[{"type":"text","id":"20vE-1674208858413","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"Rue2-1674208858416","name":"code-line","data":{},"nodes":[{"type":"text","id":"KRTY-1674208858415","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"GrgU-1674208858418","name":"code-line","data":{},"nodes":[{"type":"text","id":"0chb-1674208858417","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"kiIP-1674208858420","name":"code-line","data":{},"nodes":[{"type":"text","id":"lYTo-1674208858419","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"feeE-1674208858423","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"FRpd-1674208858422","leaves":[{"text":"响应数据","marks":[]}]}],"state":{}},{"type":"block","id":"p2Tn-1674208858517","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"QF3M-1674208858425","name":"code-line","data":{},"nodes":[{"type":"text","id":"SgQy-1674208858424","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"1uVj-1674208858427","name":"code-line","data":{},"nodes":[{"type":"text","id":"Oxmu-1674208858426","leaves":[{"text":" \"took\": 0,","marks":[]}]}]},{"type":"block","id":"UVhC-1674208858429","name":"code-line","data":{},"nodes":[{"type":"text","id":"c7S9-1674208858428","leaves":[{"text":" \"timed_out\": false,","marks":[]}]}]},{"type":"block","id":"q7Fg-1674208858431","name":"code-line","data":{},"nodes":[{"type":"text","id":"umBm-1674208858430","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"0bU1-1674208858433","name":"code-line","data":{},"nodes":[{"type":"text","id":"cO2N-1674208858432","leaves":[{"text":" \"total\": 1,","marks":[]}]}]},{"type":"block","id":"Y2L1-1674208858435","name":"code-line","data":{},"nodes":[{"type":"text","id":"QSjM-1674208858434","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"aGkn-1674208858437","name":"code-line","data":{},"nodes":[{"type":"text","id":"KiiR-1674208858436","leaves":[{"text":" \"skipped\": 0,","marks":[]}]}]},{"type":"block","id":"FmFE-1674208858439","name":"code-line","data":{},"nodes":[{"type":"text","id":"eU6T-1674208858438","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"pQGY-1674208858441","name":"code-line","data":{},"nodes":[{"type":"text","id":"QfXW-1674208858440","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"O9HS-1674208858443","name":"code-line","data":{},"nodes":[{"type":"text","id":"cIra-1674208858442","leaves":[{"text":" \"hits\": {","marks":[]}]}]},{"type":"block","id":"lqj6-1674208858445","name":"code-line","data":{},"nodes":[{"type":"text","id":"twMs-1674208858444","leaves":[{"text":" \"total\": {","marks":[]}]}]},{"type":"block","id":"hiNt-1674208858447","name":"code-line","data":{},"nodes":[{"type":"text","id":"6Hwl-1674208858446","leaves":[{"text":" \"value\": 2,","marks":[]}]}]},{"type":"block","id":"rpCL-1674208858449","name":"code-line","data":{},"nodes":[{"type":"text","id":"2aqX-1674208858448","leaves":[{"text":" \"relation\": \"eq\"","marks":[]}]}]},{"type":"block","id":"VAP0-1674208858451","name":"code-line","data":{},"nodes":[{"type":"text","id":"hHCi-1674208858450","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"f6NV-1674208858453","name":"code-line","data":{},"nodes":[{"type":"text","id":"CxRd-1674208858452","leaves":[{"text":" \"max_score\": null,","marks":[]}]}]},{"type":"block","id":"nVaa-1674208858455","name":"code-line","data":{},"nodes":[{"type":"text","id":"U1n2-1674208858454","leaves":[{"text":" \"hits\": [","marks":[]}]}]},{"type":"block","id":"ec8S-1674208858457","name":"code-line","data":{},"nodes":[{"type":"text","id":"PC0d-1674208858456","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"dylB-1674208858459","name":"code-line","data":{},"nodes":[{"type":"text","id":"1Ikg-1674208858458","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"bbf8-1674208858461","name":"code-line","data":{},"nodes":[{"type":"text","id":"G25W-1674208858460","leaves":[{"text":" \"_id\": \"tHwVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"LDfx-1674208858463","name":"code-line","data":{},"nodes":[{"type":"text","id":"Kh3k-1674208858462","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"2YhQ-1674208858465","name":"code-line","data":{},"nodes":[{"type":"text","id":"4c6U-1674208858464","leaves":[{"text":" \"fields\": {","marks":[]}]}]},{"type":"block","id":"iLkl-1674208858467","name":"code-line","data":{},"nodes":[{"type":"text","id":"XSL0-1674208858466","leaves":[{"text":" \"@timestamp\": [","marks":[]}]}]},{"type":"block","id":"jLgK-1674208858469","name":"code-line","data":{},"nodes":[{"type":"text","id":"2uPe-1674208858468","leaves":[{"text":" \"2099-05-08T16:25:42.000Z\"","marks":[]}]}]},{"type":"block","id":"lo7k-1674208858471","name":"code-line","data":{},"nodes":[{"type":"text","id":"yfYM-1674208858470","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"fsZB-1674208858473","name":"code-line","data":{},"nodes":[{"type":"text","id":"lMHn-1674208858472","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"tGl4-1674208858475","name":"code-line","data":{},"nodes":[{"type":"text","id":"ofXS-1674208858474","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"FUip-1674208858477","name":"code-line","data":{},"nodes":[{"type":"text","id":"2Zct-1674208858476","leaves":[{"text":" 4081940742000","marks":[]}]}]},{"type":"block","id":"jc22-1674208858479","name":"code-line","data":{},"nodes":[{"type":"text","id":"qE5l-1674208858478","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"vGYi-1674208858481","name":"code-line","data":{},"nodes":[{"type":"text","id":"gysG-1674208858480","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"eJRn-1674208858483","name":"code-line","data":{},"nodes":[{"type":"text","id":"w5Tv-1674208858482","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"hXPq-1674208858486","name":"code-line","data":{},"nodes":[{"type":"text","id":"IkJI-1674208858484","leaves":[{"text":" \"_index\": \"logs-myapp\",","marks":[]}]}]},{"type":"block","id":"UEpH-1674208858488","name":"code-line","data":{},"nodes":[{"type":"text","id":"spQZ-1674208858487","leaves":[{"text":" \"_id\": \"s3wVN4QBFZ31xH8HcQ8j\",","marks":[]}]}]},{"type":"block","id":"Sznb-1674208858490","name":"code-line","data":{},"nodes":[{"type":"text","id":"Pybb-1674208858489","leaves":[{"text":" \"_score\": null,","marks":[]}]}]},{"type":"block","id":"rCeA-1674208858492","name":"code-line","data":{},"nodes":[{"type":"text","id":"EVJC-1674208858491","leaves":[{"text":" \"fields\": {","marks":[]}]}]},{"type":"block","id":"DadF-1674208858494","name":"code-line","data":{},"nodes":[{"type":"text","id":"IVqf-1674208858493","leaves":[{"text":" \"@timestamp\": [","marks":[]}]}]},{"type":"block","id":"E2en-1674208858496","name":"code-line","data":{},"nodes":[{"type":"text","id":"9OR5-1674208858495","leaves":[{"text":" \"2099-05-07T16:24:32.000Z\"","marks":[]}]}]},{"type":"block","id":"TaO0-1674208858498","name":"code-line","data":{},"nodes":[{"type":"text","id":"84Xu-1674208858497","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"kNNw-1674208858500","name":"code-line","data":{},"nodes":[{"type":"text","id":"Labf-1674208858499","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"SPX5-1674208858502","name":"code-line","data":{},"nodes":[{"type":"text","id":"K3cv-1674208858501","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"Q5X4-1674208858504","name":"code-line","data":{},"nodes":[{"type":"text","id":"GSXF-1674208858503","leaves":[{"text":" 4081854272000","marks":[]}]}]},{"type":"block","id":"M4Er-1674208858506","name":"code-line","data":{},"nodes":[{"type":"text","id":"thrE-1674208858505","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"J196-1674208858508","name":"code-line","data":{},"nodes":[{"type":"text","id":"tSXK-1674208858507","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"fmzD-1674208858510","name":"code-line","data":{},"nodes":[{"type":"text","id":"CtZW-1674208858509","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"2vsI-1674208858512","name":"code-line","data":{},"nodes":[{"type":"text","id":"9GvT-1674208858511","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"EF4h-1674208858514","name":"code-line","data":{},"nodes":[{"type":"text","id":"SLwv-1674208858513","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"pzPM-1674208858516","name":"code-line","data":{},"nodes":[{"type":"text","id":"r8jo-1674208858515","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"xFro-1674208858665","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"KGsj-1674208858518","leaves":[{"text":"8、搜索文档内容-查询范围","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"W2OL-1674208858521","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"UOKY-1674208858520","leaves":[{"text":"对过去一天进行查询 ,表达式","marks":[]}]}],"state":{}},{"type":"block","id":"kbBN-1674208858570","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"Di0V-1674208858523","name":"code-line","data":{},"nodes":[{"type":"text","id":"2u6x-1674208858522","leaves":[{"text":"GET logs-myapp/_search","marks":[]}]}]},{"type":"block","id":"dsM0-1674208858525","name":"code-line","data":{},"nodes":[{"type":"text","id":"13oD-1674208858524","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"NdIl-1674208858527","name":"code-line","data":{},"nodes":[{"type":"text","id":"gLqW-1674208858526","leaves":[{"text":" \"query\": {","marks":[]}]}]},{"type":"block","id":"xusb-1674208858529","name":"code-line","data":{},"nodes":[{"type":"text","id":"fWlm-1674208858528","leaves":[{"text":" \"range\": {","marks":[]}]}]},{"type":"block","id":"QZMT-1674208858531","name":"code-line","data":{},"nodes":[{"type":"text","id":"T1bE-1674208858530","leaves":[{"text":" \"@timestamp\": {","marks":[]}]}]},{"type":"block","id":"v6GT-1674208858533","name":"code-line","data":{},"nodes":[{"type":"text","id":"IIM0-1674208858532","leaves":[{"text":" \"gte\": \"now-1d/d\",","marks":[]}]}]},{"type":"block","id":"YDBm-1674208858535","name":"code-line","data":{},"nodes":[{"type":"text","id":"PSoF-1674208858534","leaves":[{"text":" \"lte\": \"now/d\"","marks":[]}]}]},{"type":"block","id":"794N-1674208858538","name":"code-line","data":{},"nodes":[{"type":"text","id":"nxZ3-1674208858537","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"3MXG-1674208858540","name":"code-line","data":{},"nodes":[{"type":"text","id":"ZxtZ-1674208858539","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"Dqqc-1674208858542","name":"code-line","data":{},"nodes":[{"type":"text","id":"VoUq-1674208858541","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"Iisk-1674208858544","name":"code-line","data":{},"nodes":[{"type":"text","id":"88bs-1674208858543","leaves":[{"text":" \"fields\": [","marks":[]}]}]},{"type":"block","id":"YqWU-1674208858546","name":"code-line","data":{},"nodes":[{"type":"text","id":"VzkC-1674208858545","leaves":[{"text":" \"@timestamp\"","marks":[]}]}]},{"type":"block","id":"3gMx-1674208858548","name":"code-line","data":{},"nodes":[{"type":"text","id":"U3GQ-1674208858547","leaves":[{"text":" ],","marks":[]}]}]},{"type":"block","id":"RKEK-1674208858550","name":"code-line","data":{},"nodes":[{"type":"text","id":"bwJJ-1674208858549","leaves":[{"text":" \"_source\": false,","marks":[]}]}]},{"type":"block","id":"wP2L-1674208858552","name":"code-line","data":{},"nodes":[{"type":"text","id":"NB8J-1674208858551","leaves":[{"text":" \"sort\": [","marks":[]}]}]},{"type":"block","id":"Zhos-1674208858554","name":"code-line","data":{},"nodes":[{"type":"text","id":"Gls5-1674208858553","leaves":[{"text":" {","marks":[]}]}]},{"type":"block","id":"qdkA-1674208858556","name":"code-line","data":{},"nodes":[{"type":"text","id":"62xM-1674208858555","leaves":[{"text":" \"@timestamp\": {","marks":[]}]}]},{"type":"block","id":"95n3-1674208858558","name":"code-line","data":{},"nodes":[{"type":"text","id":"ocJV-1674208858557","leaves":[{"text":" \"order\": \"desc\"","marks":[]}]}]},{"type":"block","id":"WtJc-1674208858561","name":"code-line","data":{},"nodes":[{"type":"text","id":"bFFg-1674208858560","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"x6VF-1674208858563","name":"code-line","data":{},"nodes":[{"type":"text","id":"BmD7-1674208858562","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"VWIn-1674208858565","name":"code-line","data":{},"nodes":[{"type":"text","id":"eqbZ-1674208858564","leaves":[{"text":" ]","marks":[]}]}]},{"type":"block","id":"l7p5-1674208858567","name":"code-line","data":{},"nodes":[{"type":"text","id":"mobn-1674208858566","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"70tf-1674208858569","name":"code-line","data":{},"nodes":[{"type":"text","id":"miz3-1674208858568","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"AIn5-1674208858572","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"f00v-1674208858571","leaves":[{"text":"响应数据","marks":[]}]}],"state":{}},{"type":"block","id":"2pSm-1674208858611","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"f6qm-1674208858574","name":"code-line","data":{},"nodes":[{"type":"text","id":"Mmzs-1674208858573","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"QI5Y-1674208858576","name":"code-line","data":{},"nodes":[{"type":"text","id":"qQbh-1674208858575","leaves":[{"text":" \"took\": 0,","marks":[]}]}]},{"type":"block","id":"XxTV-1674208858578","name":"code-line","data":{},"nodes":[{"type":"text","id":"flH9-1674208858577","leaves":[{"text":" \"timed_out\": false,","marks":[]}]}]},{"type":"block","id":"do50-1674208858580","name":"code-line","data":{},"nodes":[{"type":"text","id":"8Kr6-1674208858579","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"bMgc-1674208858582","name":"code-line","data":{},"nodes":[{"type":"text","id":"wNSO-1674208858581","leaves":[{"text":" \"total\": 1,","marks":[]}]}]},{"type":"block","id":"z39R-1674208858584","name":"code-line","data":{},"nodes":[{"type":"text","id":"yGPs-1674208858583","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"JVmQ-1674208858586","name":"code-line","data":{},"nodes":[{"type":"text","id":"GsN6-1674208858585","leaves":[{"text":" \"skipped\": 0,","marks":[]}]}]},{"type":"block","id":"PrI3-1674208858588","name":"code-line","data":{},"nodes":[{"type":"text","id":"PUBj-1674208858587","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"1lmr-1674208858590","name":"code-line","data":{},"nodes":[{"type":"text","id":"mf7h-1674208858589","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"WsSY-1674208858592","name":"code-line","data":{},"nodes":[{"type":"text","id":"CylV-1674208858591","leaves":[{"text":" \"hits\": {","marks":[]}]}]},{"type":"block","id":"oI48-1674208858594","name":"code-line","data":{},"nodes":[{"type":"text","id":"WSpF-1674208858593","leaves":[{"text":" \"total\": {","marks":[]}]}]},{"type":"block","id":"WvGj-1674208858596","name":"code-line","data":{},"nodes":[{"type":"text","id":"apvT-1674208858595","leaves":[{"text":" \"value\": 0,","marks":[]}]}]},{"type":"block","id":"OI2Y-1674208858598","name":"code-line","data":{},"nodes":[{"type":"text","id":"1Due-1674208858597","leaves":[{"text":" \"relation\": \"eq\"","marks":[]}]}]},{"type":"block","id":"py0U-1674208858600","name":"code-line","data":{},"nodes":[{"type":"text","id":"9i9h-1674208858599","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"Zren-1674208858602","name":"code-line","data":{},"nodes":[{"type":"text","id":"SrAl-1674208858601","leaves":[{"text":" \"max_score\": null,","marks":[]}]}]},{"type":"block","id":"rfbn-1674208858604","name":"code-line","data":{},"nodes":[{"type":"text","id":"aJMS-1674208858603","leaves":[{"text":" \"hits\": []","marks":[]}]}]},{"type":"block","id":"tyqo-1674208858606","name":"code-line","data":{},"nodes":[{"type":"text","id":"E8Bh-1674208858605","leaves":[{"text":" }","marks":[]}]}]},{"type":"block","id":"8fQ0-1674208858608","name":"code-line","data":{},"nodes":[{"type":"text","id":"41Za-1674208858607","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"bXcm-1674208858610","name":"code-line","data":{},"nodes":[{"type":"text","id":"tKaP-1674208858609","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"1ac5-1674208858666","name":"heading","data":{"version":1,"level":"h3"},"nodes":[{"type":"text","id":"go5h-1674208858612","leaves":[{"text":"9、搜索文档内容-提取内容","marks":[{"type":"bold"},{"type":"fontSize","value":20}]}]}]},{"type":"block","id":"AkRy-1674208858626","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"XCbk-1674208858615","name":"code-line","data":{},"nodes":[{"type":"text","id":"emEb-1674208858614","leaves":[{"text":"POST logs-test/_doc/1","marks":[]}]}]},{"type":"block","id":"mT7n-1674208858617","name":"code-line","data":{},"nodes":[{"type":"text","id":"SELU-1674208858616","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"Zmm5-1674208858619","name":"code-line","data":{},"nodes":[{"type":"text","id":"OhM1-1674208858618","leaves":[{"text":" \"raw_message\":\"199.72.81.55 - - [01/Jul/1995:00:00:01 -0400] GET /history/apollo/ HTTP/1.0 200 6245\",","marks":[]}]}]},{"type":"block","id":"vLV5-1674208858621","name":"code-line","data":{},"nodes":[{"type":"text","id":"717r-1674208858620","leaves":[{"text":" \"address\":\"1.2.3.4\"","marks":[]}]}]},{"type":"block","id":"ouYW-1674208858623","name":"code-line","data":{},"nodes":[{"type":"text","id":"YylE-1674208858622","leaves":[{"text":"}","marks":[]}]}]},{"type":"block","id":"v099-1674208858625","name":"code-line","data":{},"nodes":[{"type":"text","id":"A4NM-1674208858624","leaves":[{"text":"","marks":[]}]}]}],"state":{}},{"type":"block","id":"vL5G-1674208858628","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"8sVQ-1674208858627","leaves":[{"text":"结果","marks":[]}]}],"state":{}},{"type":"block","id":"V1sr-1674208858656","name":"code","data":{"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"KoXE-1674208858630","name":"code-line","data":{},"nodes":[{"type":"text","id":"pwuQ-1674208858629","leaves":[{"text":"{","marks":[]}]}]},{"type":"block","id":"7bZk-1674208858632","name":"code-line","data":{},"nodes":[{"type":"text","id":"5qzZ-1674208858631","leaves":[{"text":" \"_index\": \"logs-test\",","marks":[]}]}]},{"type":"block","id":"zZeA-1674208858634","name":"code-line","data":{},"nodes":[{"type":"text","id":"5Gwc-1674208858633","leaves":[{"text":" \"_id\": \"1\",","marks":[]}]}]},{"type":"block","id":"JeZp-1674208858636","name":"code-line","data":{},"nodes":[{"type":"text","id":"yFDR-1674208858635","leaves":[{"text":" \"_version\": 1,","marks":[]}]}]},{"type":"block","id":"IQik-1674208858639","name":"code-line","data":{},"nodes":[{"type":"text","id":"MnBB-1674208858638","leaves":[{"text":" \"result\": \"created\",","marks":[]}]}]},{"type":"block","id":"27HD-1674208858641","name":"code-line","data":{},"nodes":[{"type":"text","id":"TK39-1674208858640","leaves":[{"text":" \"_shards\": {","marks":[]}]}]},{"type":"block","id":"ezvX-1674208858643","name":"code-line","data":{},"nodes":[{"type":"text","id":"OciF-1674208858642","leaves":[{"text":" \"total\": 2,","marks":[]}]}]},{"type":"block","id":"jxtu-1674208858645","name":"code-line","data":{},"nodes":[{"type":"text","id":"A1dU-1674208858644","leaves":[{"text":" \"successful\": 1,","marks":[]}]}]},{"type":"block","id":"p9yy-1674208858647","name":"code-line","data":{},"nodes":[{"type":"text","id":"MDb6-1674208858646","leaves":[{"text":" \"failed\": 0","marks":[]}]}]},{"type":"block","id":"Icnx-1674208858649","name":"code-line","data":{},"nodes":[{"type":"text","id":"QPaj-1674208858648","leaves":[{"text":" },","marks":[]}]}]},{"type":"block","id":"Zt7y-1674208858651","name":"code-line","data":{},"nodes":[{"type":"text","id":"6Vuy-1674208858650","leaves":[{"text":" \"_seq_no\": 0,","marks":[]}]}]},{"type":"block","id":"DDnC-1674208858653","name":"code-line","data":{},"nodes":[{"type":"text","id":"cux6-1674208858652","leaves":[{"text":" \"_primary_term\": 1","marks":[]}]}]},{"type":"block","id":"8dqM-1674208858655","name":"code-line","data":{},"nodes":[{"type":"text","id":"UY0H-1674208858654","leaves":[{"text":"}","marks":[]}]}]}],"state":{}},{"type":"block","id":"6s7U-1674208858685","name":"heading","data":{"version":1,"level":"h2"},"nodes":[{"type":"text","id":"dzP6-1674208858684","leaves":[{"text":"","marks":[{"type":"bold"},{"type":"fontSize","value":22}]}]}]}]">

四、常见的操作指南

下面是一些日常使用疑问


1、如何kibana调用es接口命令

登录kibana系统后,在菜单栏中Management->Dev Tools, 进入后我们在左侧框中输入(先清空),输入下面的内容

GET /

右侧栏中会出现一段json,可以看到我们的es版本等信息

{  "name": "dae8747df6f0",  "cluster_name": "docker-cluster",  "cluster_uuid": "toprRlPKRv22cMX8gh96LQ",  "version": {    "number": "8.4.3",    "build_flavor": "default",    "build_type": "docker",   "build_hash": "42f05b9372a9a4a470db3b52817899b99a76ee73",    "build_date": "2022-10-04T07:17:24.662462378Z",    "build_snapshot": false,    "lucene_version": "9.3.0",    "minimum_wire_compatibility_version": "7.17.0",    "minimum_index_compatibility_version": "7.0.0"  },  "tagline": "You Know, for Search"}


2、添加单个文档

提交以下索引请求以将单个日志条目添加到 logs-myapp 数据流。

由于 logs-myapp不存在,请求会使用内置的 logs-*-* 索引模板自动创建它。

这里模拟的是一个请求的文件日志记录

POST logs-myapp/_doc{  "@timestamp"


    
: "2099-05-06T16:21:15.000Z",  "event": {    "original": "192.0.2.42 - - [06/May/2099:16:21:15 +0000] \"GET /images/bg.jpg HTTP/1.0\" 200 24736"  }}

返回数据

响应包括 Elasticsearch 为文档生成的元数据:

  • 包含文档的支持 _index。Elasticsearch 会自动生成支持索引的名称。

  • 索引中文档的唯一 _id。

{  "_index": "logs-myapp",  "_id": "snwQN4QBFZ31xH8Hlg-J",  "_version": 1,  "result": "created",  "_shards": {    "total": 2,    "successful": 1,    "failed": 0  },  "_seq_no": 0,  "_primary_term": 1}


3、添加多个文档

使用 _bulk 端点在一个请求中添加多个文档。批量数据必须是换行符分隔的 JSON (NDJSON)。每行必须以换行符 (\n) 结尾,包括最后一行。

PUT logs-myapp/_bulk{ "create": { } }{ "@timestamp": "2099-05-07T16:24:32.000Z", "event": { "original": "192.0.2.242 - - [07/May/2020:16:24:32 -0500] \"GET /images/hm_nbg.jpg HTTP/1.0\" 304 0" } }{ "create": { } }{ "@timestamp": "2099-05-08T16:25:42.000Z", "event": { "original": "192.0.2.255 - - [08/May/2099:16:25:42 +0000] \"GET /favicon.ico HTTP/1.0\" 200 3638" } }

响应数据

{  "took": 28,  "errors": false,  "items": [    {      "create": {        "_index": "logs-myapp",        "_id": "s3wVN4QBFZ31xH8HcQ8j",        "_version": 1,        "result": "created",        "_shards": {          "total": 2,          "successful": 1,          "failed": 0        },        "_seq_no": 1,        "_primary_term": 1,        "status": 201      }    },    {      "create": {        "_index": "logs-myapp",        "_id": "tHwVN4QBFZ31xH8HcQ8j",        "_version": 1,        "result": "created",        "_shards": {          "total": 2,          "successful": 1,          "failed": 0        },        "_seq_no": 2,        "_primary_term": 1,        "status": 201      }    }  ]}

4、查看当前索引

GET _cat/indices

5、搜索文档内容

查询条件为所有条目,

按字段@timestamp降序排列

GET logs-myapp/_search{  "query": {    "match_all": {}  },  "sort": [    {      "@timestamp": {        "order": "desc"      }    }  ]}

返回结果

{  "took": 0,  "timed_out": false,  "_shards": {    "total": 1,    "successful": 1,    "skipped": 0,    "failed": 0  },  "hits": {    "total": {      "value": 3,      "relation": "eq"    },    "max_score": null,    "hits": [      {        "_index": "logs-myapp",        "_id": "tHwVN4QBFZ31xH8HcQ8j",        "_score": null,        "_source": {          "@timestamp": "2099-05-08T16:25:42.000Z",          "event": {            "original": """192.0.2.255 - - [08/May/2099:16:25:42 +0000] "GET /favicon.ico HTTP/1.0" 200 3638"""          }        },        "sort": [          4081940742000        ]      },      {        "_index": "logs-myapp",        "_id": "s3wVN4QBFZ31xH8HcQ8j",        "_score": null,        "_source": {          "@timestamp": "2099-05-07T16:24:32.000Z",          "event": {            "original": """192.0.2.242 - - [07/May/2020:16:24:32 -0500] "GET /images/hm_nbg.jpg HTTP/1.0" 304 0"""          }        },        "sort": [          4081854272000        ]      },      {        "_index": "logs-myapp",        "_id": "snwQN4QBFZ31xH8Hlg-J",        "_score": null,        "_source": {          "@timestamp": "2099-05-06T16:21:15.000Z",          "event": {            "original": """192.0.2.42 - - [06/May/2099:16:21:15 +0000] "GET /images/bg.jpg HTTP/1.0" 200 24736"""          }        },        "sort": [          4081767675000        ]      }    ]


    
  }}

6、搜索文档内容-特定字段

对于大文档,解析整个_source很麻烦,

我们需要将_source参数置为false。

然后从fields参数中来检索想要的字段

GET logs-myapp/_search{  "query": {    "match_all": {}  },  "fields": [    "@timestamp"  ],  "_source": false,  "sort": [    {      "@timestamp": {        "order": "desc"      }    }  ]}

响应数据

{  "took": 0,  "timed_out": false,  "_shards": {    "total": 1,    "successful": 1,    "skipped": 0,    "failed": 0  },  "hits": {    "total": {      "value": 3,      "relation": "eq"    },    "max_score": null,    "hits": [      {        "_index": "logs-myapp",        "_id": "tHwVN4QBFZ31xH8HcQ8j",        "_score": null,        "fields": {          "@timestamp": [            "2099-05-08T16:25:42.000Z"          ]        },        "sort": [          4081940742000        ]      },      {        "_index": "logs-myapp",        "_id": "s3wVN4QBFZ31xH8HcQ8j",        "_score": null,        "fields": {          "@timestamp": [            "2099-05-07T16:24:32.000Z"          ]        },        "sort": [          4081854272000        ]      },      {        "_index": "logs-myapp",        "_id": "snwQN4QBFZ31xH8Hlg-J",        "_score": null,        "fields": {          "@timestamp": [            "2099-05-06T16:21:15.000Z"          ]        },        "sort": [          4081767675000        ]      }    ]  }}

7、搜索文档内容-查询范围

在特定的时间或者IP范围内进行搜索

GET logs-myapp/_search{  "query": {    "range": {      "@timestamp": {        "gte": "2099-05-07"


    
,        "lte": "2099-05-08"      }    }  },  "fields": [    "@timestamp"  ],  "_source": false,  "sort": [    {      "@timestamp": {        "order": "desc"      }    }  ]}

响应数据

{  "took": 0,  "timed_out": false,  "_shards": {    "total": 1,    "successful": 1,    "skipped": 0,    "failed": 0  },  "hits": {    "total": {      "value": 2,      "relation": "eq"    },    "max_score": null,    "hits": [      {        "_index": "logs-myapp",        "_id": "tHwVN4QBFZ31xH8HcQ8j",        "_score": null,        "fields": {          "@timestamp": [            "2099-05-08T16:25:42.000Z"          ]        },        "sort": [          4081940742000        ]      },      {        "_index": "logs-myapp",        "_id": "s3wVN4QBFZ31xH8HcQ8j",        "_score": null,        "fields": {          "@timestamp": [            "2099-05-07T16:24:32.000Z"          ]        },        "sort": [          4081854272000        ]      }    ]  }}

8、搜索文档内容-查询范围

对过去一天进行查询 ,表达式

GET logs-myapp/_search{  "query": {    "range": {      "@timestamp": {        "gte": "now-1d/d",        "lte": "now/d"      }    }  },  "fields": [    "@timestamp"  ],  "_source": false,  "sort": [    {      "@timestamp": {        "order": "desc"      }    }  ]}

响应数据

{  "took": 0,  "timed_out": false,


    
  "_shards": {    "total": 1,    "successful": 1,    "skipped": 0,    "failed": 0  },  "hits": {    "total": {      "value": 0,      "relation": "eq"    },    "max_score": null,    "hits": []  }}

9、搜索文档内容-提取内容

POST logs-test/_doc/1{  "raw_message":"199.72.81.55 - - [01/Jul/1995:00:00:01 -0400] GET /history/apollo/ HTTP/1.0 200 6245",  "address":"1.2.3.4"}

结果

{  "_index": "logs-test",  "_id": "1",  "_version": 1,  "result": "created",  "_shards": {    "total": 2,    "successful": 1,    "failed": 0  },  "_seq_no": 0,  "_primary_term": 1}



Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/151866