Logstash - Error parsing a concrete value into object field

Hello guys,

I have a pipeline on Logstash that is parsing and filtering some data from a kafka topic. Everything is working fine but from time to time i got this error message:

"error"=>{"type"=>"mapper_parsing_exception", "reason"=>"object mapping for [debug.input.request] tried to parse field [request] as object, but found a concrete value"

The [debug.input.request] is in fact an object:

"debug": {
	"properties" : {
		"input" : {
			"properties" : {
				"request" : {
					"properties" : {

And since Logstash tried to parse a non object it is giving me the above error.
What i want to ask is the best way to catch when this field is a concrete value and map it to another field, this one not being an object.

Any ideias?


See this answer, which addresses possible solutions.