FluentdでログをS3に保存
amazon 3sにアクセスログを転送してみた。
もちろん、手順はあやしい。
#rbenv install 1.9.2-p290
#rbenv rehash
#gem install fluent-plugin-s3
で、ようやくインストール
#gem install fluentd
エラーで、はいらない。libxslt-develが必要らしい。
#yum install libxslt-devel
で、再度gem installでなんとか、入りました。
-----------------------------------------------------------------------
<source>
type tail
format apache
path /var/log/httpd/access_log
tag apache.access
</source>
<match apache.access>
type s3
aws_key_id hogehoge
aws_sec_key mogemoge
s3_bucket stsmania-buckets
s3_endpoint s3-ap-northeast-1.amazonaws.com
path logs/
buffer_path /var/log/fluentd_s3.log
time_slice_format %Y%m%d-%H
time_slice_wait 10m
utc
</match>
-----------------------------------------------------------------------
で、以前にテストで作成したうんこスクリプトで、s3の中をのぞいてみると
# perl test.pl
logs/20121012-06_0.gz
無事にできているようですね。
fluentdの設定は、 こちらを拝見させていただきましたよ。
もちろん、手順はあやしい。
- インストール
#rbenv install 1.9.2-p290
#rbenv rehash
#gem install fluent-plugin-s3
で、ようやくインストール
#gem install fluentd
エラーで、はいらない。libxslt-develが必要らしい。
#yum install libxslt-devel
で、再度gem installでなんとか、入りました。
- 続いて、fluentd.confの設定
#fluentd -s /etc/fluentd
fluent.confとpluginのディレクトリができる。
-----------------------------------------------------------------------
<source>
type tail
format apache
path /var/log/httpd/access_log
tag apache.access
</source>
<match apache.access>
type s3
aws_key_id hogehoge
aws_sec_key mogemoge
s3_bucket stsmania-buckets
s3_endpoint s3-ap-northeast-1.amazonaws.com
path logs/
buffer_path /var/log/fluentd_s3.log
time_slice_format %Y%m%d-%H
time_slice_wait 10m
utc
</match>
-----------------------------------------------------------------------
- 起動
で、以前にテストで作成したうんこスクリプトで、s3の中をのぞいてみると
# perl test.pl
logs/20121012-06_0.gz
無事にできているようですね。
fluentdの設定は、 こちらを拝見させていただきましたよ。
- 2012.10.12 Friday
- -
- 18:11
- comments(2)
- trackbacks(0)
- -
- -
- by orz
http://help.treasure-data.com/kb/installing-td-agent-daemon/installing-td-agent-for-redhat-and-centos