LoginSignup
11
10

More than 5 years have passed since last update.

fluentd の timezone バグにはまった(v0.10.45)

Last updated at Posted at 2014-06-24

fluentd のバグにはまった

fluentd 最新版 2014/06/19: version v1.1.20 をインストール(自動だと)すると、fluentd v0.10.50 がインストールされるのだけど、このバージョンでは timezone がうまく処理されないバグがあるようです。

具体的には、timezone の処理がバグっているため type file で出力すると下記の様になる。JST(+0900) 以外も同様の現象がでてるんじゃないかな?

bug
2014-06-25T18:02:17Z    apache.access   {"host":"192.168.11.1","user":null,・・・

本来は

ok
2014-06-26T03:02:17+09:00    apache.access   {"host":"192.168.11.1","user":null,・・・

回避方法

fluentd v0.10.45 では、本現象がでていないので指定のバージョンを yum でインストール(ダウングレード)する。
32/64bit でパッケージ名が異なるので、そこらへんは適宜 http://packages.treasure-data.com/redhat/ で調べること。

command
$ sudo yum remove td-agent-1.1.20-0.x86_64
$ sudo yum install td-agent-1.1.19-0.x86_64
$ td-agent --version
td-agent 0.10.45

yum で自動更新している場合

yum の fastestmirror を導入していると折角ダウングレードしたのが最新化されてしまうので /etc/yum.conf に以下を追加する。

exclude=td-*

yum によるパッケージ管理

テンプレ・・・が

初心者っぽい初期の設定で悩んでいました。この時期に fluentd を導入するぞ!って人・・・私も含めつまずくよな~。と私も、2日悩んだw

お約束のテンプレ、指定が間違っていないのに・・・出力結果が違うよ!!て、そりゃ悩むよね。

/etc/td-agent/td-agent.conf
<source>
  type tail
  path /var/log/httpd/access_log
  tag apache.access
  pos_file /var/log/td-agent/httpd-access.log.pos
  format apache2
</source>

<match apache.access>
  type copy

  <store>
    type stdout
  </store>

  <store>
    type file
    path /tmp/aaaaa
    time_slice_format %Y%m%d_%H%M
    time_slice_wait 1m
  </store>
</match>
11
10
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
10