Trim promtail logs and get only specific part of logs

I have Loki, Prometheus, and grafana deployed on my Kubernetes Cluster. and I am getting so much data in logs apart from the ones I want.

Logs Generating right now:

2022-06-15 17:10:33 {“log”:“This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:\n”,“stream”:“stderr”,“time”:“2022-06-15T11:40:33.290860813Z”}.

Logs Part I want:

{log":"This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason}.

Attaching the Screenshots as well

What I actually want in logs

Someone, please help me out with the same
Thanks in advance

1 Like