首页 > 其他 > 详细

openfalcon的 日志文件监控 logdog

时间:2018-06-01 14:24:32      阅读:332      评论:0      收藏:0      [点我收藏+]
https://github.com/sdvdxl/falcon-logdog
下载解压后,需要配置一下文件就好了,我的一个典型配置文件如下:
{
"logLevel": "WARN",
"metric": "log",
"timer": 60,
"agent": "http://127.0.0.1:1988/v1/push",
"host": "10.0.100.85",
"files": [
{
"path": "/opt/machtalk/logs/xcloud-cm",
"prefix": "xcloud-cm",
"suffix": "log",
"keywords": [
{
"exp": "closing socket connection and attempting reconnect",
"tag": "error"
},
{
"exp": "服务器下线: null",
"tag": "error"
}
]
},
{
"path": "/opt/abc/logs/xcloud-1",
"prefix": "xcloud-1",
"suffix": "log",
"keywords": [
{
"exp": "closing socket connection and attempting reconnect",
"tag": "error"
}
]
},
{
"path": "/opt/abc/logs/xcloud-2",
"prefix": "xcloud-2",
"suffix": "log",
"keywords": [
{
"exp": "closing socket connection and attempting reconnect",
"tag": "error"
}
]
},
{
"path": "/opt/abc/logs/xcloud-3",
"prefix": "xcloud-3",
"suffix": "log",
"keywords": [
{
"exp": "closing socket connection and attempting reconnect",
"tag": "error"
}
]
}
]
}

上面的配置,是分别针对3个目录,日志有prefix和suffix,进行日志过滤,如果发现 closing socket connection and attempting reconnect, 那么计数器+1.
TIP1
如果过滤的字符中有 “汉字”,那么在执行过滤任务的时候会算在内,但是在显示的时候会被忽略
如果过滤的字符中有 “空格”,那么在执行过滤任务的时候回算在内,但是在显示的时候会算成”.”

openfalcon的 日志文件监控 logdog

原文:http://blog.51cto.com/ershao/2123050

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!