“基于大数据的运维分析系统”的版本间的差异
(→已落实接口) |
(→已落实接口) |
||
(未显示同一用户的9个中间版本) | |||
第67行: | 第67行: | ||
服务运行状态<br> | 服务运行状态<br> | ||
+ | |||
+ | Mysql | ||
+ | curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' | ||
+ | {"_source":["message"], | ||
+ | "query":{"match":{"message":"mysqld"}}}' | ||
+ | nginx | ||
+ | curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' | ||
+ | {"_source":["message"], | ||
+ | "query":{"match":{"message":"nginx"}}}' | ||
+ | filebeat | ||
+ | curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' | ||
+ | {"_source":["message"], | ||
+ | "query":{"match":{"message":"filebeat"}}}' | ||
+ | web网页 | ||
+ | curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' | ||
+ | {"_source":["message"], | ||
+ | "query":{"match":{"message":"网页"}}}' | ||
+ | elsearch | ||
+ | curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' | ||
+ | {"_source":["message"], | ||
+ | "query":{"match":{"message":"elasticsearch"}}}' | ||
+ | |||
+ | |||
+ | |||
+ | 查询 近7日 error级及以上日志 总数 的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-7d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近6日 error级及以上日志 总数 的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-6d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 查询 近5日 error级及以上日志 总数 的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-5d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近4日 error级及以上日志 总数 的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-4d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 查询 近3日 error级及以上日志 总数 的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-3d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 查询 近2日 error级及以上日志 总数 的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-2d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近1日 error级及以上日志 总数 的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 查询 近7日 warning级别 日志 总数的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-7d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近6日 warning级别 日志 总数的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-6d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 查询 近5日 warning级别 日志 总数的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-5d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近4日 warning级别 日志 总数的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-4d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近3日 warning级别 日志 总数的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-3d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近2日 warning级别 日志 总数的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-2d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 查询 近1日 warning级别 日志 总数的命令 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 统计今日不同级别的日志数量: | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d/d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 统计各级别日志总数今日Warning出现次数 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*warning*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 统计各级别日志总数今日error出现次数 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 统计各级别日志总数今日critical出现次数 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*critical*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | 统计各级别日志总数今日INFO出现次数 | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*info*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 各服务Error级别以及以上日志总数(今日)Mysql | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/mysql-javadaemon/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | |||
+ | 各服务Error级别以及以上日志总数(今日)nginx | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200inx-javadaemon/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | 各服务Error级别以及以上日志总数(今日)elsearch | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/elsearchlog-javadaemon/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | 各服务Error级别以及以上日志总数(今日)filebeat | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200/filebeat-javadaemon/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | 各服务Error级别以及以上日志总数(今日)kafka | ||
+ | |||
+ | curl -H 'content-Type:application/json' '39.101.189.249:9200fka-javadaemon/_search?pretty' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-1d", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "aggs":{ | ||
+ | "group_by_height":{ | ||
+ | "terms":{ | ||
+ | "field":"msg_type","include":".*error*." | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | |||
+ | 最近5分钟Mysql日志 | ||
+ | |||
+ | curl -H 'content-Type:application/json' 'master:9200/mysql-javadaemon/_doc/_search?pretty&size=1000' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-5m", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "_source":[ | ||
+ | "message" | ||
+ | ] | ||
+ | }' | ||
+ | |||
+ | 最近5分钟nginx日志 | ||
+ | |||
+ | curl -H 'content-Type:application/json' 'master:9200inx-javadaemon/_doc/_search?pretty&size=1000' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-5m", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "_source":[ | ||
+ | "message" | ||
+ | ] | ||
+ | }' | ||
+ | |||
+ | 最近5分钟elsearch日志 | ||
+ | |||
+ | curl -H 'content-Type:application/json' 'master:9200/elsearchlog-javadaemon/_doc/_search?pretty&size=1000' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-5m", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "_source":[ | ||
+ | "message" | ||
+ | ] | ||
+ | }' | ||
+ | |||
+ | 最近5分钟kafka日志 | ||
+ | |||
+ | curl -H 'content-Type:application/json' 'master:9200fka-javadaemon/_doc/_search?pretty&size=1000' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-5m", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "_source":[ | ||
+ | "message" | ||
+ | ] | ||
+ | }' | ||
+ | |||
+ | 最近5分钟filebeat日志 | ||
+ | |||
+ | curl -H 'content-Type:application/json' 'master:9200/filebeat-javadaemon/_doc/_search?pretty&size=1000' -d' | ||
+ | { | ||
+ | "query" : { | ||
+ | "constant_score" : { | ||
+ | "filter" : { | ||
+ | "range" : { | ||
+ | "@timestamp" : { | ||
+ | "gt": "now-5m", "lt": "now" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | "_source":[ | ||
+ | "message" | ||
+ | ] | ||
+ | }' | ||
+ | |||
+ | 运行日志查询elsearch | ||
+ | curl -H 'content-Type:application/json' 'master:9200/elsearchlog-javadaemon/_doc/_search?pretty&size=1000' | ||
+ | 运行日志查询filebeat | ||
+ | curl -H 'content-Type:application/json' 'master:9200/filebeat-javadaemon/_doc/_search?pretty&size=1000' | ||
+ | 运行日志查询kafka | ||
+ | curl -H 'content-Type:application/json' 'master:9200fka-javadaemon/_doc/_search?pretty&size=1000' | ||
+ | 运行日志查询mysql | ||
+ | curl -H 'content-Type:application/json' 'master:9200/mysql-javadaemon/_doc/_search?pretty&size=1000' | ||
+ | 运行日志查询nginx | ||
+ | curl -H 'content-Type:application/json' 'master:9200inx-javadaemon/_doc/_search?pretty&size=1000' | ||
===未落实接口=== | ===未落实接口=== | ||
日志错误数量<br> | 日志错误数量<br> | ||
爬虫运营状态<br> | 爬虫运营状态<br> |
2020年9月15日 (二) 15:24的最新版本
vue前端
ElasticSearch 后台
已落实接口
CPU状态
curl -H 'content-Type:application/json' 'master:9200/cpu-javadaemon/_doc/_search?pretty&size=1000' -d' { "_source":[ "message" ] }'
运行时间
curl -H 'content-Type:application/json' '39.101.189.249:9200sj-javadaemon/_doc/_search?pretty&size=1000' -d' { "_source":[ "message" ] }'
启动时间
curl -H 'content-Type:application/json' '39.101.189.249:9200/kjsj-javadaemon/_doc/_search?pretty&size=1000' -d' { "_source":[ "message" ] }'
负载情况
curl -H 'content-Type:application/json' '39.101.189.249:9200/serverxt-javadaemon/_doc/_search?pretty&size=1000' -d' { "_source":[ "message" ] }'
网卡速率
curl 'master:9200/wksl-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' {"_source":["message"], "query":{"match":{"message":"eth0"}}}'
硬盘状态
curl -H 'content-Type:application/json' 'master:9200/disk-javadaemon/_doc/_search?pretty&size=1000' -d' { "_source":[ "message" ] }'
内存状态
curl -H 'content-Type:application/json' 'master:9200/memory-javadaemon/_doc/_search?pretty&size=1000' -d' { "_source":[ "message" ] }'
服务运行状态
Mysql
curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' {"_source":["message"], "query":{"match":{"message":"mysqld"}}}'
nginx
curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' {"_source":["message"], "query":{"match":{"message":"nginx"}}}'
filebeat
curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' {"_source":["message"], "query":{"match":{"message":"filebeat"}}}'
web网页
curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' {"_source":["message"], "query":{"match":{"message":"网页"}}}'
elsearch
curl 'master:9200/yxzt-javadaemon/_doc/_search?pretty' -H 'content-Type:application/json' -d ' {"_source":["message"], "query":{"match":{"message":"elasticsearch"}}}'
查询 近7日 error级及以上日志 总数 的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-7d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
查询 近6日 error级及以上日志 总数 的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-6d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
查询 近5日 error级及以上日志 总数 的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-5d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
查询 近4日 error级及以上日志 总数 的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-4d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
查询 近3日 error级及以上日志 总数 的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-3d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
查询 近2日 error级及以上日志 总数 的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-2d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
查询 近1日 error级及以上日志 总数 的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
查询 近7日 warning级别 日志 总数的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-7d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
查询 近6日 warning级别 日志 总数的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-6d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
查询 近5日 warning级别 日志 总数的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-5d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
查询 近4日 warning级别 日志 总数的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-4d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
查询 近3日 warning级别 日志 总数的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-3d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
查询 近2日 warning级别 日志 总数的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-2d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
查询 近1日 warning级别 日志 总数的命令
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
统计今日不同级别的日志数量:
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d/d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type" } } } }'
统计各级别日志总数今日Warning出现次数
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*warning*." } } } }'
统计各级别日志总数今日error出现次数
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
统计各级别日志总数今日critical出现次数
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*critical*." } } } }'
统计各级别日志总数今日INFO出现次数
curl -H 'content-Type:application/json' '39.101.189.249:9200/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*info*." } } } }'
各服务Error级别以及以上日志总数(今日)Mysql
curl -H 'content-Type:application/json' '39.101.189.249:9200/mysql-javadaemon/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
各服务Error级别以及以上日志总数(今日)nginx
curl -H 'content-Type:application/json' '39.101.189.249:9200inx-javadaemon/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
各服务Error级别以及以上日志总数(今日)elsearch
curl -H 'content-Type:application/json' '39.101.189.249:9200/elsearchlog-javadaemon/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
各服务Error级别以及以上日志总数(今日)filebeat
curl -H 'content-Type:application/json' '39.101.189.249:9200/filebeat-javadaemon/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
各服务Error级别以及以上日志总数(今日)kafka
curl -H 'content-Type:application/json' '39.101.189.249:9200fka-javadaemon/_search?pretty' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-1d", "lt": "now" } } } } }, "aggs":{ "group_by_height":{ "terms":{ "field":"msg_type","include":".*error*." } } } }'
最近5分钟Mysql日志
curl -H 'content-Type:application/json' 'master:9200/mysql-javadaemon/_doc/_search?pretty&size=1000' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-5m", "lt": "now" } } } } }, "_source":[ "message" ] }'
最近5分钟nginx日志
curl -H 'content-Type:application/json' 'master:9200inx-javadaemon/_doc/_search?pretty&size=1000' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-5m", "lt": "now" } } } } }, "_source":[ "message" ] }'
最近5分钟elsearch日志
curl -H 'content-Type:application/json' 'master:9200/elsearchlog-javadaemon/_doc/_search?pretty&size=1000' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-5m", "lt": "now" } } } } }, "_source":[ "message" ] }'
最近5分钟kafka日志
curl -H 'content-Type:application/json' 'master:9200fka-javadaemon/_doc/_search?pretty&size=1000' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-5m", "lt": "now" } } } } }, "_source":[ "message" ] }'
最近5分钟filebeat日志
curl -H 'content-Type:application/json' 'master:9200/filebeat-javadaemon/_doc/_search?pretty&size=1000' -d' { "query" : { "constant_score" : { "filter" : { "range" : { "@timestamp" : { "gt": "now-5m", "lt": "now" } } } } }, "_source":[ "message" ] }'
运行日志查询elsearch
curl -H 'content-Type:application/json' 'master:9200/elsearchlog-javadaemon/_doc/_search?pretty&size=1000'
运行日志查询filebeat
curl -H 'content-Type:application/json' 'master:9200/filebeat-javadaemon/_doc/_search?pretty&size=1000'
运行日志查询kafka
curl -H 'content-Type:application/json' 'master:9200fka-javadaemon/_doc/_search?pretty&size=1000'
运行日志查询mysql
curl -H 'content-Type:application/json' 'master:9200/mysql-javadaemon/_doc/_search?pretty&size=1000'
运行日志查询nginx
curl -H 'content-Type:application/json' 'master:9200inx-javadaemon/_doc/_search?pretty&size=1000'
未落实接口
日志错误数量
爬虫运营状态