Unable to read two json

Hello, I have a python file that is executed by logstash and which prints a json composed of two different data sources, the problem is that logstash only reads the first part. I tried to change the order and nothing changes, it is always the first part taken into account
(One of the part contains the field "Type")

filter {

	if ([Type]){
	  	SOMETHING
	} else {
		SOMETHING
	}
}

Thanks