fluent unique counter plugin
This plugin purpose is simple monitoring (countup only). This was referred from fluent-plugin-numeric-counter. Thanks! :)
Add this line to your application's Gemfile:
gem 'fluent-plugin-unique-counter'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fluent-plugin-unique-counter
<source>
type forward
port 24224
</source>
<match test.api.*>
type unique_counter
tag count.up
unique_key user_id
unit minutes
</match>
<match count.up>
type file
path fluent/count-up.log
</match>
echo '{"user_id": 1000}' | fluent-cat test.api.uga
echo '{"user_id": 1000}' | fluent-cat test.api.uga
echo '{"user_id": 1000}' | fluent-cat test.api.uga
echo '{"user_id": 1002}' | fluent-cat test.api.uga
echo '{"user_id": 1002}' | fluent-cat test.api.uga
echo '{"user_id": 1003}' | fluent-cat test.api.uga
echo '{"user_id": 1003}' | fluent-cat test.api.uga
2013-10-21T22:07:08+09:00 count.up {"unique_count":3}
count_interval
This interval time to monitoring. Default setting is 60sec
.
unit
Monitoring specific interval an unit. Selectable setting is minutes
, hours
and days
.
unique_key
Monitoring key name.
tag
Output tag name. Default setting is unique_count
.
Apache License v2.0.
Copylight (c) 2013 Aiming Inc.