logstash/logstash — pull request #216 by jwoltman (2012-09-30 13:15:37+00:00)
Title: Added MDC to fields section in Log4j input

Hi,

We're using Log4j MDC a lot. To let Logstash parse these properties as well. I did a little enhancement to the Log4J input class.

# Add the MDC context proeprties to '@fields'
if event_obj.getProperties()
event_obj.getPropertyKeySet().each do |key|
event_data["@fields"][key] = event_obj.getProperty(key)
end
end

Regards, Jurjan