dwbutler / logstash-logger

Ruby logger that writes logstash events
MIT License
454 stars 118 forks source link

Add pre and post custom_event #154

Open idoa01 opened 5 years ago

idoa01 commented 5 years ago

custom_event is pretty useful but I'm facing a small issue with it. In the custom_event block, I'm overwriting the default host param, but I also want to be able to overwrite my default host with something else in a specific place.

currently, the custom_event block runs after everything so I'm always overwriting everything. I think that adding another pre_custom_event and post_custom_event which will run before setting the Event data and after everything (respectively) so I can decide if I want my event to be overwritten with the message or not.

the current custom_event could stay the same of course to preserve backward compatibility.