Black Friday sale: an extra 40% off every course until Monday, November 30.New Year sale: an extra 30% off every course until Friday, January 1.Memorial Day sale: an extra 25% off every course until Monday, May 31.SysAdmin Day sale: an extra 25% off every course until Sunday, August 1.Back to School sale: an extra 25% off every course until Sunday, August 22.Labor Day sale: an extra 25% off every course until Monday, September 6.Black Friday sale: an extra 40% off every course until Monday, November 29.New Year sale: an extra 30% off every course until Saturday, January 1.Choose your certification →

Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

3.2.2.7. Associating CloudWatch Alarms with Metrics

3.2.2.7. Log Analytics: Kinesis, Athena & Logs Insights

Different log analysis tools serve different query patterns. The exam tests whether you choose the right tool for the scenario.

ToolQuery TypeLatencyBest For
CloudWatch Logs InsightsInteractive SQL-likeSecondsAd-hoc investigation, recent logs
Amazon AthenaFull SQLSeconds-minutesHistorical analysis, S3-stored logs
Amazon OpenSearchFull-text search, dashboardsSub-secondComplex search, Kibana-style visualization
Amazon Managed Service for Apache FlinkStreaming Flink SQL (Studio), Java, or PythonReal-timeContinuous aggregation, live anomaly detection
CloudWatch Logs Insights examples:
# Top 10 most expensive Lambda invocations
fields @requestId, @billedDuration, @memorySize
| sort @billedDuration desc
| limit 10

# Error rate per 5-minute window
filter @message like /ERROR/
| stats count(*) as errors by bin(5m)

Athena for S3 logs (CloudTrail, ALB access logs, VPC Flow Logs):

-- Find all unauthorized API calls in CloudTrail
SELECT eventtime, eventsource, eventname, useridentity.arn
FROM cloudtrail_logs
WHERE errorcode = 'AccessDenied'
  AND eventtime > current_timestamp - interval '24' hour
ORDER BY eventtime DESC;

Exam Trap: Logs Insights queries scan all data in the selected log groups for the time range — cost scales with data volume. For frequently-run queries on large log groups, export to S3 and use Athena with partitioning (by date, account, region) to scan only relevant data. Athena with partitioned data can be 10-100x cheaper than repeated Logs Insights queries. Partitioning only helps when queries filter on the partition columns: write Firehose output under date-based prefixes (e.g., Hive-style year=/month=/day=) and use Athena partition projection so new days are queryable without crawlers or MSCK REPAIR TABLE. Format changes such as CSV or GZIP shrink files but still scan every day.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•26 professional certifications earned