启动
nohup ./bin/logstash -f ./pipelines/log_collect.conf 1>nohup.loog 2>nohup.log &3.3、部署客户端filebeat日志格式如下
gtms-switch-center 2022-04-19 17:28:14.616 [http-nio-8080-exec-989] INFO c.p.switchcenter.web.controller.SwitchController1、linux系统
tar -xvf filebeat.tar.gzcd filebeat/
vi filebeat.ymlfilebeat.prospectors: - input_type: log paths: - /bankapp/switch/gtms-switch-center/com.pactera.jep.log.biz*.log multiline: pattern: '^gtms-switch-center' negate: true match: after max_lines: 200 timeout: 20s fields: env: "prd001" appid: "switch" appname: "switch" hostip: "192.168.10.15" reload.enabled: true reload.period: 2Sfields_under_root: trueoutput.logstash: hosts: ["192.168.10.11:10515" ] enabled: true
nohup ./filebeat -e -c filebeat.yml -d "publish" 1>/dev/null 2>&1 &2、windows系统
- windows安装直接解压即可,解压如下

文章插图
- 编写配置文件filebeat.yml
filebeat.prospectors: - input_type: log encoding: gbk paths: - C:/bankapp/switch/gtms-switch-center/com.pactera.jep.log.biz*.log multiline: pattern: '^gtms-switch-center' negate: true match: after max_lines: 200 timeout: 20s fields: env: "prd001" appid: "switch" appname: "switch" hostip: "192.168.10.16" reload.enabled: true reload.period: 2S fields_under_root: trueoutput.logstash: hosts: ["192.168.10.11:10515" ] enabled: true
- 编写后台启动脚本startFilebeat.vbs
set ws=WScript.CreateObject("WScript.Shell")ws.Run "filebeat.exe -e -c filebeat.yml",0
- 启动 , 双击脚本startFilebeat.vbs

文章插图
3.4、grafana查看日志用grafana查看日志,可以根据自己的删选条件(关键字、时间等)选择查询响应的日志信息,具体如图

文章插图

文章插图

文章插图
第四节、自定义监控自定义监控可以根据自己编写的脚本,把需要监控的监控指标发送到pushgateway上,最后存储在promethues,使用grafana查看 。
4.1、pushgateway1、部署pushgateway
tar -xvf pushgateway-1.4.2.linux-amd64.tar.gzcd pushgateway-1.4.2.linux-amd64/启动
nohup ./pushgateway --web.listen-address=:48888 1>nohup.log 2>&1 &2、promethues集成pushgateway
- job_name: 'pushgateway' static_configs: - targets: [‘192.168.10.10:48888'] labels: instance: pushgateway
- 重启prometheus
推荐阅读
-
都江堰市2023年小升初入学指南 都江堰市小升初招生网
-
-
-
-
-
-
-
国漫天官赐福让原著粉丝飘了,你认为是尬捧还是真的好看?
-
宁夏理工学院2022年分省分专业招生计划(本科+专科)
-
-
-
-
-
北京天马旅行社有限公司_工商信用信息_经营范围期限状态_法人_地址_注册资本_怎么样
-
-
-
-
王者荣耀背景修改,王者荣耀实名制弄错了怎么修改?,
-
冷冻的面包吃的时候应该怎么处理 冷冻的面包吃的时候应该怎么处理呢
-