-
查询最近7天的数据量
curl -XGET 'http://user:password@ip:9200/access.log/_count' -H 'Content-Type: application/json' -d ' { "query": { "range": { "@timestamp": { "gte": "now-7d/d", "lte": "now/d" } } } }'
-
查询最新的一条数据
curl -X GET "http://user:password@ip:9200/access.log/_search?pretty=true" -H 'Content-Type: application/json' -d' { "query": { "match_all": {} }, "sort": [ {"@timestamp": { "order": "desc" } } ], "size": 1}'
-
获取所有index
curl -X GET http://elastic:elastic@127.0.0.1:9200/_cat/indices/a*?v
-
创建名为
testtt
别名curl -X POST "http://elastic:elastic@127.0.0.1:9200/_aliases" -H 'Content-Type: application/json' -d ' { "actions": [ { "add": { "index": "a_test_info", "alias": "testtt" } }, { "add": { "index": "a_test1_info", "alias": "testtt" } }, { "add": { "index": "a_test_data", "alias": "testtt" } }, ] }'
-
知道需要查询的字段不知道具体内容,模糊查询
curl -X GET "http://elastic:elastic@127.0.0.1:9200/testtt/_search" -H 'Content-Type: application/json' -d ' { "query": { "match": { "contract_status": "待定" } } }'
-
查询别名,模糊查询只知道要查什么
curl -X GET "http://elastic:elastic@127.0.0.1:9200/testtt/_search" -H 'Content-Type: application/json' -d ' { "query": { "multi_match": { "query": "80000", "fields": ["*"] } } }'
-
查询index类型
curl -X GET "http://elastic:elastic@127.0.0.1:9200/tmp_test1/_mapping" -H 'Content-Type: application/json'
-
查询指定index中的数据量
curl http://elastic:elastic@127.0.0.1:9200/tmp_test1/_count?pretty
-
查询最近七天的数据
curl -XGET 'http://elastic:elastic@127.0.0.1:9200/tmp_test1/_count' -H 'Content-Type: application/json' -d ' { "query": { "range": { "@timestamp": { "gte": "now-7d/d", "lte": "now/d" } } } }'
-
删除指定的index
curl -X DELETE "http://elastic:elastic@192.168.90.60:9200/tmp_test1"
最新评论
# 这只是一个创建远程登录并授权的语句、仅作为记录 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Fit2cloud!' WITH GRANT OPTION;
当MGR集群初始化结束后,需要开启MGR集群自启动(需要有一台节点是自动开启引导) loose-group_replication_start_on_boot = ON #设置节点是否在启动时自动启动 MGR 集群 loose-group_replication_bootstrap_group = ON #设置节点是否作为初始引导节点启动集群
密码:blog.sirliu.com
本内容密码:blog.sirliu.com 最新整理的文章在这里喔:https://blog.sirliu.com/2018/11/shell_lian_xi_ti.html