What you’ll do
- Open CloudWatch Log Analytics (Logs → Log Analytics).
- Select the Lambda log group you want to examine.
- Use Live Tail for near real-time visibility while invoking the Lambda.
- Switch to Logs Insights to run structured queries and filters to analyze results.
/aws/lambda/xray-demo log group). Click outside the dropdown to confirm the selection.

Enable Live Tail (near real-time streaming)
With the log group selected, enable Live Tail in CloudWatch Logs Insights to view new log events as they are ingested. Live Tail establishes a streaming connection to the selected log stream and displays new entries as they arrive. Example SOURCE for a specific log-group ARN:- Open the AWS Lambda console.
- Select the function (XRayDemo).
- Invoke it via the Test button (each invocation creates new log events).

Analyze with Logs Insights queries
While Live Tail is useful for immediate visibility, Logs Insights lets you run structured queries to aggregate, filter, and pivot on log data across time windows. You can keep Live Tail open in one tab and open Logs Insights in another. A common starting query is to show timestamp and message, newest first:Filtering for specific tokens
Filtering narrows results to events that matter. For example, find ERROR messages:START):
Quick reference — Logs Insights building blocks
Best practices and troubleshooting tips
- Use Live Tail for interactive debugging and quick feedback during tests or incident response.
- Run Logs Insights queries to aggregate across many events and identify patterns (e.g., error rates, latencies).
- Parse REPORT, START, and INIT lines to extract runtime metrics (duration, memory usage, cold start indicators).
- If filters return zero results, broaden the time range or remove the filter to confirm expected tokens exist.
- Save useful queries and pin dashboards for recurring investigations.
- Live Tail (Logs Insights) provides near real-time visibility of incoming log events — ideal for immediate troubleshooting.
- Logs Insights supports flexible, powerful queries (fields, filter, sort, limit, parse, stats) to analyze logs at scale.
- Use filters and parsing to focus on error messages, lifecycle events (START/INIT/REPORT), or custom application markers.
Use Live Tail for immediate visibility during testing or incident response, then run Logs Insights queries to aggregate and analyze patterns across many events.
Links and references
- AWS CloudWatch Logs Insights documentation
- AWS Lambda documentation
- AWS CloudWatch console (learn.kodekloud)
- AWS Lambda course (learn.kodekloud)