Is there a way to format the stringmap values in longentry template?

We are using the stdio adapter handler to get the access logs from envoy, using an instance similar to this:

spec:
  compiledTemplate: logentry
  params:
    severity: '"Default"'
    variables:
      requestHeaders: request.headers
      responseHeaders: response.headers

The access log has the entire stringmap dumped as a string:

"requestHeaders": "stringmap[:authority:service-a.domain.io :method:GET :path:/hello accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-encoding:gzip, user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0x-request-id:c0b569cb-6f25-4a01-bb77-bf1d4baeb47c]"

The header keys(:authority) or values can have colon ( : ) which makes it difficult to differentiate between header keys. Is there a way to format this stringmap to json in the template?