kbinani/fluent-plugin-redis-counter — pull request #5 by HeartSaVioR (2013-12-18 09:17:23+00:00)
Title: added feature : count_hash_key_format (write to Redis hash)

While using fluent-plugin-redis-counter, we can make count_key dynamically.
It means we need to find keys created from plugin.

Redis keys command is a bit dangerous.
(It scans all key namespace whether matched keys are few or many!)

Grouping keys can reduce target scan namespaces.

In all Redis data structure, Hash only support incr/incrby/decr/decrby.
We can freeze count_key, and made count_hash_key dynamically, and hkeys/hvals/hgetall to count_key already known.

Usage
====

In conf

````
count_key_format item_sum_count:%_{item_id}
count_hash_key_format %_{producer}-hash-key
````

Data

````
{"item_id" => 200, "producer" => "US"}
````

Output

````
hgetall item_sum_count:200
1) "US"
2) "1"
````

Commit log
====

* add functionality 'count_hash_key'
* we can use regex to count_hash_key (same to count_key)
* added unit test related count_hash_key