Multiline log in elastic agent

it depends if you're running agent as a standalone or managed by fleet.
standalone gives you more options in regards of input, so it should be able to add multiline fields into log input section and this will be send to filebeat.
if it is managed by fleet you can create policy Custom logs integrations which in Advanced options enables you to provide some yaml config part. this is where you place multiline settings.