Not able to parse custom logs having multi line xml

Previous discussions.

As you can see, this kind of thing is really hard to get 100% right. Most of the time the worst problem is that the very last character in the file is not a newline.

Another possibility is to use a python script preprocessor to read a whole file and append a minified XML string to another file that filebeat will tail.
A partial solution. python - Remove whitespaces in XML string - Stack Overflow