Multiline Python tracebacks in formatted log file?

I’ve configured promtail to apply labels based on a regex pattern for a Python application (not mine). It works well for properly formatted lines, but it doesn’t work well for unhandled Python exceptions. Is there a way to capture multiple lines as part of the message with the regex parser?

As an example, here are 2 log lines. I’d like the second line to include the entire traceback in its message. As it is now, this would record 8 separate log lines, with the last 6 having no labels. 09:42:07,791::INFO::[_cplogging:201]::[SNMPManager]::[22/Nov/2023:09:42:07] ENGINE Stopped thread 'Audit Logger'. 09:42:07,792::ERROR::[_cplogging:201]::[SNMPManager]::[22/Nov/2023:09:42:07] ENGINE Error in 'stop' listener <bound method SNMPManager.stop_monitor of <serv.bin.SNMPManager.SNMPManager object at 0x7f2c77fc3a10>>
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/lib/cherrypy/process/", line 197, in publish
  File "build/bdist.linux-x86_64/egg/serv/bin/", line 113, in stop_monitor
  File "/usr/lib64/python2.7/", line 942, in join
    raise RuntimeError("cannot join current thread")
RuntimeError: cannot join current thread

This is the pipeline I’m using:

    - regex:
        expression: '^(?P<version>.+)::(?P<time>.+)::(?P<level>.+)::\[(?P<source>.+)\]::\[(?P<component>.{1,16}).*\]::(?P<message>.+)$'
    - labels:
    - output:
        source: message

Nevermind, I found the multiline stage which handles this perfectly!

    - multiline:
        firstline: '^.+::.+::.+::.+::.+::.*'
        max_wait_time: 1s

Now I’m just being picky, but I would prefer if the Grafana panel collapsed the log to a single line until you click on it. Is that possible?