No commit activity in last 3 years
No release in over 3 years
This plugin is use of count up to unique attribute.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Fluentd unique counter plugin

Build Status Gem Version

This plugin purpose is simple monitoring (countup only). This was referred from fluent-plugin-numeric-counter. Thanks! :)

Contributors

Installation

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

How to use

  • create fluentd config file
<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>
  • send test data
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
  • result (count-up.log)
2013-10-21T22:07:08+09:00       count.up        {"unique_count":3}

config params

  • 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.

License

Apache License v2.0.

Copyright

Copyright (c) 2013 Aiming Inc.

Bitdeli Badge