Parsing Stringified JSON in AWS CloudWatch Log Streams
The Stringified JSON Problem
AWS Lambda writes objects to CloudWatch as escaped strings: {"level":"info","msg":"hello"} becomes "{\"level\":\"info\",\"msg\":\"hello\"}" inside the log line. Reading it raw is painful.
Extraction Strategy
- Isolate the stringified segment between the outer quotes.
- Unescape
\\"→"and\\n→ newlines. - Parse the inner JSON.
One-Click Formatting
Paste the raw CloudWatch line into the FormatHub AWS CloudWatch Log Formatter. It strips timestamps, unescapes nested quotes, and indents the stringified JSON automatically — no server round-trip, so your logs stay private.