Re: how to import fluentd stdout into log file

51 views
Skip to first unread message

Mr. Fiber

unread,
Oct 19, 2016, 7:12:44 AM10/19/16
to Fluentd Google Group
Could you show me your configuration?

On Wed, Oct 19, 2016 at 12:28 PM, Jin Aazoe <mvpan...@gmail.com> wrote:
    hello repeatedly,it's me again~ 
    Right now Iam testing td-agent log function.
    When I use 
td-agent -o/log/td-agent.log
    this log file'c content doesn't match td-agents stdout outputs,for example:
1.stdout:
2016-10-19 03:23:14 +0000 [debug]: listening http on 0.0.0.0:8826
2016-10-19 03:23:14 +0000 [info]: listening fluent socket on 0.0.0.0:8726
2016-10-19 03:23:14 +0000 [info]: launching child fluentd -c /home/work/app/portal/conf/fluent1.conf -p /home/work/app/portal/plugin/
2016-10-19 03:23:19 +0000 [info]: reading config file path="/home/work/app/portal/conf/fluent1.conf"
2016-10-19 03:23:19 +0000 [info]: starting fluentd-0.12.26
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-mixin-config-placeholders' version '0.4.0'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-mixin-plaintextformatter' version '0.2.6'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-elasticsearch' version '1.7.0'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-mongo' version '0.7.13'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-multiprocess' version '0.2.1'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-rewrite-tag-filter' version '1.5.5'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-s3' version '0.6.8'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-scribe' version '0.10.14'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-td' version '0.10.28'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-td-monitoring' version '0.2.2'
2016-10-19 03:23:20 +0000 [info]: gem 'fluent-plugin-webhdfs' version '0.4.2'
2016-10-19 03:23:20 +0000 [info]: gem 'fluentd' version '0.12.26'
2016-10-19 03:23:26 +0000 [error]: error test
2016-10-19 03:23:26 +0000 [fatal]: fatal test
2016-10-19 03:23:26 +0000 [info]: info test


2.log file:
在此输入代码...2016-10-19 03:17:39 +0000 [info]: launching child fluentd -c /home/work/app/portal/conf/fluent-conf.conf -p /home/work/app/portal/plugin/
2016-10-19 03:17:40 +0000 [info]: launching child fluentd -c /home/work/app/portal/conf/fluent2.conf -p /home/work/app/portal/plugin/
2016-10-19 03:17:41 +0000 [info]: launching child fluentd -c /home/work/app/portal/conf/fluent1.conf -p /home/work/app/portal/plugin/


I test to change log level to warn,error and fatal, but it seems not working.
I check source code and find all stdout just use puts function,like warn:
puts [@color_warn, caller_line(time, @depth_offset, LEVEL_WARN), msg, @color_reset].join

now ,here's my question, how can I make stdouts into log files

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mr. Fiber

unread,
Oct 19, 2016, 8:29:33 AM10/19/16
to Fluentd Google Group
I tested and the contents are same.

% fluentd -c in_forward.conf
2016-10-19 21:26:10 +0900 [info]: reading config file path="in_forward.conf"
2016-10-19 21:26:10 +0900 [info]: starting fluentd-0.12.29
2016-10-19 21:26:10 +0900 [info]: gem 'fluent-mixin-config-placeholders' version '0.3.1'
2016-10-19 21:26:10 +0900 [info]: gem 'fluent-plugin-beats' version '0.1.1'
2016-10-19 21:26:10 +0900 [info]: gem 'fluent-plugin-elasticsearch' version '1.7.0'
2016-10-19 21:26:10 +0900 [info]: gem 'fluent-plugin-flowcounter-simple' version '0.0.4'
2016-10-19 21:26:10 +0900 [info]: gem 'fluent-plugin-s3' version '0.7.1'
2016-10-19 21:26:10 +0900 [info]: gem 'fluent-plugin-secure-forward' version '0.4.2'
2016-10-19 21:26:10 +0900 [info]: gem 'fluent-plugin-td' version '0.10.29'
2016-10-19 21:26:10 +0900 [info]: gem 'fluentd' version '0.12.29'
2016-10-19 21:26:10 +0900 [info]: adding match pattern="debug.**" type="stdout"
2016-10-19 21:26:10 +0900 [info]: adding source type="forward"
2016-10-19 21:26:10 +0900 [info]: using configuration file: <ROOT>
  <source>
    @type forward
  </source>
  <match debug.**>
    @type stdout
  </match>
</ROOT>
2016-10-19 21:26:10 +0900 [info]: listening fluent socket on 0.0.0.0:24224
^C2016-10-19 21:26:11 +0900 [info]: shutting down fluentd
2016-10-19 21:26:11 +0900 [info]: shutting down input type="forward" plugin_id="object:3fda99951ba0"
2016-10-19 21:26:11 +0900 [info]: shutting down output type="stdout" plugin_id="object:3fda9988d9a8"
2016-10-19 21:26:11 +0900 [info]: process finished code=0

% fluentd -c in_forward.conf -o in_forward.log
^C
% /Users/repeatedly/tmp/fluentd% cat in_forward.log
2016-10-19 21:26:18 +0900 [info]: reading config file path="in_forward.conf"
2016-10-19 21:26:18 +0900 [info]: starting fluentd-0.12.29
2016-10-19 21:26:18 +0900 [info]: gem 'fluent-mixin-config-placeholders' version '0.3.1'
2016-10-19 21:26:18 +0900 [info]: gem 'fluent-plugin-beats' version '0.1.1'
2016-10-19 21:26:18 +0900 [info]: gem 'fluent-plugin-elasticsearch' version '1.7.0'
2016-10-19 21:26:18 +0900 [info]: gem 'fluent-plugin-flowcounter-simple' version '0.0.4'
2016-10-19 21:26:18 +0900 [info]: gem 'fluent-plugin-s3' version '0.7.1'
2016-10-19 21:26:18 +0900 [info]: gem 'fluent-plugin-secure-forward' version '0.4.2'
2016-10-19 21:26:18 +0900 [info]: gem 'fluent-plugin-td' version '0.10.29'
2016-10-19 21:26:18 +0900 [info]: gem 'fluentd' version '0.12.29'
2016-10-19 21:26:18 +0900 [info]: adding match pattern="debug.**" type="stdout"2016-10-19 21:26:18 +0900 [info]: adding source type="forward"
2016-10-19 21:26:18 +0900 [info]: using configuration file: <ROOT>
  <source>
    @type forward
  </source>
  <match debug.**>
    @type stdout
  </match>
</ROOT>
2016-10-19 21:26:18 +0900 [info]: listening fluent socket on 0.0.0.0:24224
2016-10-19 21:26:20 +0900 [info]: shutting down fluentd
2016-10-19 21:26:20 +0900 [info]: shutting down input type="forward" plugin_id="object:3ff159c37384"
2016-10-19 21:26:20 +0900 [info]: shutting down output type="stdout" plugin_id="object:3ff15986f328"
2016-10-19 21:26:20 +0900 [info]: process finished code=0
Reply all
Reply to author
Forward
0 new messages