RFC: pass original event obj to codec on_event call


Currently the @codec.on_event block gets called with one parameter: data, or payload.

This means the on_event block does not have access to the original event object, so it cannot do things like:

Please add the original event object as 2nd parameter, so outputs plugins can get codec support without loosing functionality.


Jordan Sissel
January 14, 2014, 7:42 PM

This is not possible for codecs that operate on more than one event, for example, the compress_spooler codec.

I'm open to fixing this as it is a known issue, but I don't think the proposed solution (adding a 2nd parameter) will solve it because sometimes there is no "the" event but simply "many" events or possibly "no" events.

Renzo Toma (moved to gchat)
January 15, 2014, 8:27 AM

Thanks for the explanation.

Looking at outputs/zeromq I see you already noticed this issue:

I hope you can think of a solution.

Will Appleby
February 24, 2014, 10:43 AM

I would also love to see this fixed due to its impact on https://logstash.jira.com/browse/LOGSTASH-1786 and as a result we are now tied to Logstash 1.2.x and won't be able to upgrade our shippers until this is resolved as we rely on the dynamic routing key functionality to push messages to the appropriate queues.

Philippe Weber
March 3, 2015, 6:23 AM

This was fixed for rabbitmq in https://github.com/logstash-plugins/logstash-output-rabbitmq/commit/def38a4bce8b26afa6c7dd2b61c71115b98a15cb

If this behaviour is missing for another plugin please open a new issue on its github repository for better visibility


Logstash Developers


Renzo Toma (moved to gchat)


Fix versions

Affects versions