More Related Content
Similar to メタプログラミングRuby勉強会#7(fluentプラグイン)
Similar to メタプログラミングRuby勉強会#7(fluentプラグイン) (20)
More from Ashitaba YOSHIOKA
More from Ashitaba YOSHIOKA (18)
メタプログラミングRuby勉強会#7(fluentプラグイン)
- 4. どう変更する?
• 現在出力内容のログレコード部分がJSONになるの
をタブ区切りにしたい
# 変更前
2013-10-27T07:40:41Z s3.apache.access
{"host":"::1","user":null,"method":"GET","path":"/","code":200,"size":44,"referer":null,"ag
ent":null,"tag":"s3.apache.access","time":"2013-10-27T07:40:41Z"}
2013-10-27T07:40:41Z s3.apache.access
{"host":"::1","user":null,"method":"GET","path":"/","code":200,"size":44,"referer":null,"ag
ent":null,"tag":"s3.apache.access","time":"2013-10-27T07:40:41Z"}
# 変更後
200 ::1
200 ::1
200 ::1
GET
GET
GET
/
/
/
44
44
44
s3.apache.access
s3.apache.access
s3.apache.access
2013-10-27T07:50:47Z
2013-10-27T07:50:47Z
2013-10-27T07:50:47Z
4
- 6. プラグイン用ディレクトリへコピー
• $ cp ./fluent-plugin-s3/lib/fluent/plugin/out_s3.rb
/etc/fluent/plugin/out_s3yoshio.rb
• あとは,out_s3yoshio.rbを少し変更すればよい
プラグインを動作させる方法の例
・/etc/fluent/plugin/にrubyスクリプトを置く
・lib/fluent/plugin/<TYPE>_<NAME>.rbを持つGemを作ってインストー
ル
6