fluentd 相关

安装 centos 直接
http://docs.fluentd.org/articles/install-by-rpm 就可以,其实就是td-agent
/etc/init.d/td-agent stop start restart....

fluentd tail 正则测试
http://fluentular.herokuapp.com/
很强大 直接可以自己测试自己写的正则文件,对应mongodb 和其他 插入插件

处理bind9 info级别的 日志正则
(?<time>[^ ]* [^ ]*) queries: client (?<client-ip>[^ ]*)#(?<port>[^ ]*): view (?<view>[^ ]*): query: (?<query>[^ ]*) IN (?<type>[^ ].*) \+ \((?<destination-ip>[^ ].*)\)

注意上面的#号在 测试网站上好用,但是linux里面就不好用,\#转义也不好使,要用\x23


(?<time>[^ ]* [^ ]*) queries: client (?<client-ip>[^ ]*)\x23(?<port>[^ ]*): view (?<view>[^ ]*): query: (?<query>[^ ]*) IN (?<type>[^ ].*) \+ \((?<destination-ip>[^ ].*)\)

/var/log/td-agent 里面有日志文件 可以查看不成功原因

ruby gem 方式安装

http://docs.fluentd.org/articles/install-by-gem 官网详解,主要关注生成配置文件的地方,生成在root目录下面,
ps -ef | grep fluentd
查看 进程 如果 fluentd已经启动的话,需要需要kill -9 【进程号】

猜你喜欢

转载自mthxunlei.iteye.com/blog/1982915
今日推荐