无法用Fluentd解析Sub第二次

时间:2017-04-14 03:12:20

标签: fluentd

我已经尝试使用流畅的in_tail插件第二次解析第14.14节了。
我期待这一点。

2017-04-13T08:20:24.369011+09:00    log.error.bar   
{"pid":"1","message":"exception instance is nil"}
2017-04-13T08:20:30.428146+09:00    log.error.bar   
{"pid":"1","message":"exception instance is nil"}

但流利的人无法像这样抓住它。

fluentd.conf

<source>
  type tail
  format multiline
  format_firstline /^time:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{6}$/
  format1  /^time:(?<time>.*)\n/
  format2  /pid:(?<pid>.*)\n/
  format3  /message:(?<message>.*)$/
  time_format %Y-%m-%d %H:%M:%S.%L
  path /Users/foo/work/bar/log/error.log
  pos_file /tmp/hoge.pos
  tag log.error.bar
  read_from_head true
</source>

<match log.error.bar>
  type file
  path /Users/foo/work/fluent/log/bar/error/test.log
  time_format %Y-%m-%d %H:%M:%S.%L
</match>

test.log中

time:2017-04-13 07:20:24.369011
pid:1
message:exception instance is nil

time:2017-04-13 07:20:30.428146
pid:1
message:exception instance is nil

然后用fluend捕获 每行都没有sub sec信息...

2017-04-13T08:20:24+09:00   log.error.bar   {"pid":"1","message":"exception instance is nil"}
2017-04-13T08:20:30+09:00   log.error.bar   {"pid":"1","message":"exception instance is nil"}

代码有什么问题?
你能教我如何用流利的in_tail捕捉子时间吗?

0 个答案:

没有答案