logstash-input-http icon indicating copy to clipboard operation
logstash-input-http copied to clipboard

Default application of json codec and ECS

Open TheVastyDeep opened this issue 3 years ago • 2 comments

For Content-Type application/json the json codec is used by default. That is helpful, but with the introduction of ECS it creates an issue. If the target option on the codec is not set (and the plugin does not set it) then logstash logs an INFO message about ECS compatibility is enabled but target option was not specified. This can be worked around using

additional_codecs => {}
codec => json { target => "[document]" }

but that is not very obvious, and it is not specific to the Content-Type. Perhaps the documentation should address this.

TheVastyDeep avatar May 10 '22 16:05 TheVastyDeep

absolutely! took me few hours just to understand how to place the http body fields into the target field. (codec => json { target => "[document]" } is not working unless you specify additional_codecs => {})

Eliav2 avatar Mar 26 '23 14:03 Eliav2