Parsing multiline logs in Logstash

Maybe it's the aggregate plugin which you're looking for?
https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html