fluent/fluentd — pull request #314 by sabottenda (2014-05-06 12:24:26+00:00)
Title: make chunk key configurable from plugins

A key name of chunk can be specified in 4th argument of `BufferedOutput#emit` in BufferedOutput class, but no one use this argument and no hook point for setting the value. It is good to be able to configure it from plugins like `format`.

If this feature is available, plugins can determine how to handle chunks depending on the chunk key. For instance, destination server is determined by the tag. I know the example can be achieved by using fluent-plugin-forest. Though I think it is easy to provide a plugin with built-in features like fluent-plugin-hash-forward.

Actually I want to set the key name from *log data*, but it is inefficient to call `chunk_key` for each message just like `format`. For that purpose, I think Mixin approach is better and allow `format` to also return a key name of chunk. How do you think about it?