Adding custom field support to Ruby code

Added by EL Mine 4 months ago

Hi,

I'm using the Redmine plugin for Logstash and its working great. The fields that are supported by default are limited but I managed to add support for some basic fields such as category_id by simply copying existing code and changing the names.

However I'd also like to have support for custom fields as I use them quite a lot. I have no programming experience but looking at the code it cannot be too hard?

https://github.com/logstash-plugins/logstash-output-redmine/blob/master/lib/logstash/outputs/redmine.rb

I tried adding something like
@issue["issue"]["custom_fields"]["6"]["value"] = "#{@custom_field}" if not @fixed_version_id.nil?

Looks correct looking at the JSON but unfortunately that didn't work. I know this is probably not the right place to ask but how would I modify this code to support custom fields?