Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · SCS-C03

Log analysis and troubleshooting

SCS-C03 · Lesson 3 of 22 · 19:03

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the SCS-C03 exam (AWS Certified Security – Specialty). In this lesson: CloudWatch Logs Insights for recent log groups, Amazon Athena with partition projection for years of logs in S3, OCSF normalization, Amazon OpenSearch Service, Security Analytics, and Amazon Managed Grafana, correlating one identifier (an access key, an IP address, a domain) across sources, missing logs caused by permissions (Lambda execution role, API Gateway role, logging never turned on), and troubleshooting the CloudWatch agent. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Reading the logs

At three in the morning, GuardDuty raises a finding: the credentials of a clinician role were used from an unusual country. The logs are all there, but someone must read them, link them together, and notice when one source goes silent. This lesson covers log analysis, normalization and correlation, and the troubleshooting of logging itself.

Analyzing logs

Each tool fits a kind of question. CloudWatch Logs Insights queries one or more log groups interactively, with its own query language, OpenSearch PPL, or SQL, which suits recent logs such as Lambda errors. Athena runs SQL on the logs in S3, such as years of CloudTrail files, and partition projection keeps each scan small and cheap. Security Hub findings are already analyzed for you: filter them by severity, resource, or account, and open the details from GuardDuty or Inspector.

Normalizing and correlating

Logs from different sources use different names for the same thing, such as a source IP address, so normalize them first. OCSF gives all of them one schema, which is why Security Lake and Security Hub use it, and a Lambda function can parse and enrich custom logs before they land. Amazon OpenSearch Service indexes logs for fast search, and its Security Analytics plugin runs detection rules over them and correlates findings across log types. Amazon Managed Grafana then draws dashboards that correlate metrics, logs, and traces from many sources, with no Grafana servers to run.

Following one identifier

Correlation means following one identifier across sources. Start from the GuardDuty finding, take the access key ID, and search the CloudTrail events made with it, then take the IP address of the instance, and search the flow logs. Take the domain from the finding, and search the Resolver query logs, all within the same time window. A common schema makes these joins simple, which is the point of OCSF, and saved queries make the next investigation start faster.

When logging fails

Sometimes the logs that you need are not there, and the cause is often a permission. A Lambda function writes its logs with its execution role, so a role without permission to create log streams and put log events leaves the log group empty. API Gateway writes execution logs and access logs through an IAM role that you set in the account settings, once per Region, with the managed policy that pushes logs to CloudWatch. And CloudFront logging is off until you turn it on: standard access logs go to a destination such as S3 or CloudWatch Logs, and real-time logs go to a data stream.

When the agent sends nothing

On instances, missing logs usually point to the CloudWatch agent. Check the role of the instance first, which needs the CloudWatch agent server policy, then the configuration file, where a wrong log file path or a wrong log group name sends nothing. Check that the instance can reach the CloudWatch endpoints, through the internet or through VPC endpoints, and read the log file of the agent itself, which lists every error. And if metrics seem missing, look in the right namespace: by default, the agent publishes them under C W Agent.

Recap

Let's recap. Logs Insights queries recent log groups, and Athena with partition projection queries years of logs in S3. OCSF normalizes logs, and OpenSearch, Security Analytics, and Managed Grafana search, correlate, and draw them. Correlation follows one identifier, such as an access key, an IP address, or a domain, across sources. Missing logs often come from a permission: the Lambda execution role, the API Gateway role, or logging that was never turned on. And for the CloudWatch agent, check the role, the configuration, the network path, and its own log.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. AnyCompany Health keeps seven years of CloudTrail files in S3. An investigator must find every console sign-in of one user in 2025, with SQL, and keep the cost of each query low. What should the security engineer use?

    • CloudWatch Logs Insights on a log group
    • Athena with partition projection
    • An Amazon Managed Grafana dashboard
    • Security Hub CSPM security controls
    Show the answer

    Athena with partition projection

    Athena queries the CloudTrail files where they are, in S3, with SQL, and partition projection limits each scan to the dates and accounts in the query. “CloudWatch Logs Insights on a log group” would only work on logs sent to CloudWatch Logs, and these seven years are in S3. “An Amazon Managed Grafana dashboard” is for drawing dashboards, not for searching old files. And “Security Hub CSPM security controls” would check configurations, not search past events.

  2. A developer added a new Lambda function with a custom execution role. The function runs, but its log group stays empty. What is the most likely cause?

    • CloudTrail data events are turned off
    • The memory of the function is set too low
    • The log group has no retention period
    • The execution role cannot write to CloudWatch Logs
    Show the answer

    The execution role cannot write to CloudWatch Logs

    Lambda writes the logs of a function with its execution role, which needs permission to create log streams and put log events, as in the basic execution role policy of Lambda. “CloudTrail data events are turned off” is about API calls made to Lambda, not the output of the function. “The memory of the function is set too low” would slow the function down or make it fail, not hide its logs. And “The log group has no retention period” would keep the logs forever, not hide them.

  3. The CloudWatch agent runs on fifty instances in private subnets with no internet access, but no logs arrive. The instance role and the configuration file are correct. What should the security engineer add?

    • A Route 53 health check on each instance
    • An account-level retention policy
    • An interface VPC endpoint for CloudWatch Logs
    • A larger instance type for each server
    Show the answer

    An interface VPC endpoint for CloudWatch Logs

    Without internet access, the agent needs an interface VPC endpoint to reach CloudWatch Logs privately. “A Route 53 health check on each instance” would check the health of an endpoint, not deliver any logs. “An account-level retention policy” is about how long logs are kept, once they arrive. And “A larger instance type for each server” would add capacity, but no network path.