fluentdのプラグインを書く練習をする為にsecureログをparseしてZabbixで値が取得できるようにしてみた(作成編)
fluentdのプラグインを書く練習をする為にsecureログをparseしてZabbixで値が取得できるようにしてみた(設定編)
/etc/fluent-agent-lite.conf
TAG_PREFIX=""
LOGS=$(cat <<"EOF"
secure /var/log/secure
EOF
)
PRIMARY_SERVER="0.0.0.0:24224"
/etc/td-agent/td-agent.conf
<source>
type forward
port 24224
</source>
<match secure>
type securelog-parser
tag seclog.local
</match>
<match seclog.*>
type copy
<store>
type datacounter
count_key message
aggregate all
tag check.seclog
pattern1 acce Accepted
pattern2 fail failure
pattern3 inva Invalid
</store>
<store>
type file
path /tmp/hoge
</store>
</match>
TODO: Write a gem description
Add this line to your application's Gemfile:
gem 'fluent-plugin-securelog-parser'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fluent-plugin-securelog-parser
TODO: Write usage instructions here
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request