Skip to content

Decode an AWS CloudWatch Logs event

Remove the Base64 and Gzip transport layers from a CloudWatch Logs subscription event, then format its JSON payload.

Install in Serialize

What it can do

  • Decode the AWS Base64 transport wrapper
  • Decompress the Gzip envelope
  • Format and sort the recovered JSON

How the recipe works

From Base64

Recover the compressed event bytes.

Gunzip

Decompress the CloudWatch Logs envelope.

JSON Beautify

Indent the JSON and sort object keys for stable review.

Demonstration

Sample input

H4sIAAAAAAAAEzWOwQqCQBgGXyW+84LrZloLHoTEU6e8RcSWPyK5rviviYjvHhLNdRiYBZaYTU3l3BM0zlmZPS759ZoVOQTc1NEAjVDto0OcHE8yVBBoXV0MbuyhEZiJg9bYZ2WCiqz72fxDnWfo24Km2noI+MYSe2N76DCRkYwTJTfEfwEa7I0fOXXvXWs8da85jRTW+/oFmIDMY6cAAAA=

Expected result

A formatted DATA_MESSAGE containing /aws/lambda/demo and one log event.

When to use it

  • Lambda subscription debugging
  • Inspecting archived CloudWatch events
  • Explaining AWS log delivery formats

Adapt it

Append a Jsonata Query to select logEvents.message, owner, or logGroup after the envelope is decoded.

Source and verification

Adapted from Thomas Leplus: CyberChef recipes. The explanation and sample are written for Serialize, use synthetic or documentation-safe data, and are checked against the current operation catalogue. The workflow runs locally without an external API call.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close