Could do something like this too to set the "Logstash" specific fields like source_host, type ...

data[:header].properties[:headers].each do |headername, headervalue|
                @logger.info("Header: #{headername}=#{headervalue}")
                if e.respond_to?("#{headername}=")
                        e.method("#{headername}=").call(headervalue)
                end
        end