Fluent配置文件
# 配置文件展示 root@localhost:td-agent$ cat dokcer_in01.conf <source> type forward port 24224 bind 0.0.0.0 </source> <match *.*> type stdout </match> # 该配置文件的路径 root@localhost:td-agent$ pwd /etc/td-agent # 启动fluentd root@localhost:td-agent$ fluentd -c dokcer_in01.conf 2016-09-08 11:26:59 -0400 [info]: reading config file path="dokcer_in01.conf" 2016-09-08 11:26:59 -0400 [info]: starting fluentd-0.12.26 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-mixin-config-placeholders' version '0.4.0' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-mixin-plaintextformatter' version '0.2.6' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-plugin-mongo' version '0.7.13' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-plugin-rewrite-tag-filter' version '1.5.5' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-plugin-s3' version '0.6.8' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-plugin-scribe' version '0.10.14' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-plugin-td' version '0.10.28' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-plugin-td-monitoring' version '0.2.2' 2016-09-08 11:26:59 -0400 [info]: gem 'fluent-plugin-webhdfs' version '0.4.2' 2016-09-08 11:26:59 -0400 [info]: gem 'fluentd' version '0.12.26' 2016-09-08 11:26:59 -0400 [info]: adding match pattern="*.*" type="stdout" 2016-09-08 11:26:59 -0400 [info]: adding source type="forward" 2016-09-08 11:26:59 -0400 [info]: using configuration file: <ROOT> <source> type forward port 24224 bind 0.0.0.0 </source> <match *.*> type stdout </match> </ROOT> 2016-09-08 11:26:59 -0400 [info]: listening fluent socket on 0.0.0.0:24224
启动Docker容器
root@localhost:lee$ docker run --name test01 --log-driver=fluentd -d -p 8000:8000 \ imekaku/simple-web python /work/simple.py 8a1949fd1269ef34d091577007ee9c3694e16efc2aedc5585ff383c9804b4362 # 日志会在使用fluentd输出
fluentd操作opt
Docker文档-docker-fluentd的相关配置:Configure logging drivers – Fluentd options
Docker文档-Fluentd logging driver -for docker:Fluentd logging driver
If container cannot connect to the Fluentd daemon on
the specified address and fluentd-async-connect is not enabled, the container stops immediately.
fluentd-docker异步设置:fluentd-async-connect
使用 Fluentd 管理 Docker 日志:使用 Fluentd 管理 Docker 日志
Fluentd使用文档
博主可以写篇日志时间格式化的文章么,我现在遇到了fluentd收集的日志时区不对,造成展现时候特别麻烦要人为的进行时区偏移,没太懂到底是用filter Plugin实现还是Parser Plugin