Analysing and Correlating Logs Across Sources
This lesson explains which tools suit interactive troubleshooting, SQL analysis of archives, and SIEM-style search and correlation, and how to normalise logs from different sources.
Learning outcomes
After completing this lesson, you will be able to:
- Choose between CloudWatch Logs Insights, Athena, OpenSearch Service and Security Lake.
- Explain why logs are normalised and enriched before correlation.
- Query WAF logs to identify attacking clients.
Choosing a tool
The right log analysis tool depends on where the logs are and what you need to do with them. CloudWatch Logs Insights runs fast interactive queries over recent logs in CloudWatch log groups, using commands such as filter, stats and parse. Amazon Athena runs SQL over logs stored in S3, such as CloudTrail, ALB, CloudFront, flow logs, WAF and Security Lake data, and is cost-effective when the data is in Parquet with partition projection.
Amazon OpenSearch Service provides SIEM-like capabilities: full-text search, correlation across sources, dashboards, alerting, and security analytics with Sigma detection rules. It is fed by OpenSearch Ingestion, Firehose or Lambda, and can query Security Lake directly. Amazon Managed Grafana builds shared dashboards over CloudWatch, OpenSearch, Athena and Prometheus, with sign-in through IAM Identity Center. The following table summarises the tools.
| Tool | Best for |
|---|---|
| CloudWatch Logs Insights | Fast interactive queries over recent log groups (fields, filter, stats, parse, sort) |
| Amazon Athena | SQL over logs in S3 (CloudTrail, ALB, CloudFront, flow logs, WAF, Security Lake); cost-effective with Parquet and partition projection |
| Amazon OpenSearch Service | SIEM-like full-text search, correlation, dashboards, alerting and security analytics with Sigma rules; fed by OpenSearch Ingestion, Firehose or Lambda; can query Security Lake directly |
| Amazon Managed Grafana | Shared dashboards over CloudWatch, OpenSearch, Athena and Prometheus, with Identity Center sign-in |
The following diagram compares the two patterns that a CloudWatch Logs Insights query of blocked web requests can reveal.

Which analysis tool?
Normalising and enriching
Different log sources describe the same event in different ways: CloudTrail records an IP address as sourceIPAddress, VPC Flow Logs as srcaddr, and application logs in their own format. To correlate them, records are first normalised into a common schema, such as the Open Cybersecurity Schema Framework (OCSF) used by Amazon Security Lake. They can also be enriched with context that the raw record lacks, such as account names, geolocation of IP addresses or matches against threat intelligence. Lambda functions and Firehose data transformations commonly perform this processing before storage, so queries in Athena, OpenSearch or a SIEM can join sources on common fields.
Normalising logs
From a WAF spike to the attacking clients
AWS WAF blocked requests jump from hundreds to tens of thousands an hour. The WAF logs are in CloudWatch Logs, so Logs Insights shows which clients and rules are involved:
fields @timestamp, httpRequest.clientIp as ip, httpRequest.country as country,
terminatingRuleId as rule, httpRequest.uri as uri
| filter action = "BLOCK"
| stats count(*) as blocked by ip, country, rule
| sort blocked desc
| limit 20If a handful of IP addresses dominate under a rate-based rule, the rule is working. If thousands of addresses each send a few requests to /login, it is a distributed credential-stuffing attack, and the better control is Account Takeover Prevention or aggregation by a JA4 fingerprint rather than by IP. For the same question over months of history in S3, Athena replaces Logs Insights.
Which service gives SIEM-like search, correlation and dashboards on AWS?
Show answer
Amazon OpenSearch Service.
Exam Tips
Remember for the exam
- For SIEM-like search, correlation and dashboards on AWS, use OpenSearch Service.
- For SQL over historical logs in S3, use Athena.
- For a quick query over recent log groups, use Logs Insights.
- To enrich records in flight, use Firehose with a Lambda transformation.
- For unified dashboards across data sources, use Managed Grafana.