The Mapped Diagnostic Context, or MDC in short, is an instrument for distinguishing interleaved log output from different sources. The MDC (or ThreadContext in log4j2) is managed on a per thread basis.
logstash-gelf can extract values from the MDC and submit the values within the GELF message. There are various options how to include specific/all MDC fields:
logstash-gelf will only use not empty fields (not null) and perform by default a type discovery. Fields that contain a floating point number (e.g. 3.1415) are converted to a double/floating point number type. Integer numbers (e.g. 42) are converted to a long number type. Everything else is treated as a string.
In some rare cases it’s required to specify the data type of a particular field to always use the same data type. This can be achieved by setting the additionalFieldTypes property (e.g. additionalFieldTypes=field1=String,field2=long,field3=Long,field4=double,field5=Double). The type setting is only applied to additional (static) fields and MDC fields. System GELF fields are not affected by this setting.
The specified types apply only to the specified fields. Not specified fields follow the default rule, see above. Available types are: