启动
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武汉中考志愿填报规则详解 2021年武汉中考志愿填报时间
-
关于深圳市万科教育发展基金会简述 深圳市万科教育发展基金会
-
没有足够的可用内存来运行此程序 没有足够的可用内存来运行程序
-
-
-
-
-
-
绝地求生刺激战场军团名字怎么改?军团名字修改攻略[多图]
-
-
-
OPPO Reno6简单评测 oppo reno6有nfc吗
-
-