Fluentdでsyslog受信しようとしたらハマった

スイッチとかのログを集めようと思って下記のような設定をしてテストしてみるも、エラーを吐いてうまくいかない。

1
2
3
4
5
6
7
8
9
10
11
12
13
<source>
  type syslog
  port 514
  bind 192.168.21.1
  tag network1
</source>

<match network1.local0.*>
  type file
  buffer_type file
  path /var/log/td-agent/test.log
  compress gzip
</match>

こんなエラーを吐く。

1
2014-11-14T19:40:31+09:00    fluent.error    {"error":"invalid time format: value = 'administrator' succeeded for, error_class = ArgumentError, error = invalid strptime format - `%b %d %H:%M:%S'","message":"\"<174>'administrator' succeeded for SSH: 192.168.20.2 admin\" error=\"invalid time format: value = 'administrator' succeeded for, error_class = ArgumentError, error = invalid strptime format - `%b %d %H:%M:%S'\""}

なんでや。。。
と思いつつ、ググりまくっていたらformatを変更すればいいという情報にたどり着いた。

https://groups.google.com/forum/#!topic/fluentd/k0HU1Dkbazs

format noneを追加すればいいらしい。
試したところバッチリ動きました!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<source>
  type syslog
  format none
  port 514
  bind 192.168.21.1
  tag network1
</source>

<match network1.local0.*>
  type file
  buffer_type file
  path /var/log/td-agent/test.log
  compress gzip
</match>
1
2
3
4
2014-11-14T19:47:19+09:00    network1.local5.info    {"message":"Login succeeded for SSH: 192.168.20.2 admin"}
2014-11-14T19:47:23+09:00 network1.local5.info    {"message":"'administrator' succeeded for SSH: 192.168.20.2 admin"}
2014-11-14T19:47:26+09:00 network1.local5.info    {"message":"Configuration saved in \"CONFIG0\" by SSH(admin)"}
2014-11-14T19:52:26+09:00 network1.local5.info    {"message":"Logout from SSH: 192.168.20.2 admin"}

Comments