A SysOps Administrator needs to monitor an application log group in Amazon CloudWatch Logs. The administrator wants to receive an email notification whenever the keyword "Failed" appears in the logs. Which two configuration steps must the SysOps Administrator perform to set up this monitoring and notification? (Select TWO.)
- Create a metric filter on the log group with the filter pattern "Failed" to map log occurrences to a custom metric.Cevap
- Create a CloudWatch alarm based on the custom metric and configure it to send a notification to an Amazon SNS topic.Cevap
- CConfigure a subscription filter on the log group to stream the log events directly to an Amazon SNS topic.
- DEnable detailed monitoring on the EC2 instances hosting the application to increase the log parsing frequency to 1-minute intervals.
- EModify the log retention policy of the log group to 1 day to trigger notifications on expired log streams.
Cevap
Create a metric filter on the log group with the filter pattern "Failed" to map log occurrences to a custom metric, and create a CloudWatch alarm based on the custom metric and configure it to send a notification to an Amazon SNS topic.
To alert on specific log events in CloudWatch Logs, you must first create a metric filter on the target log group. The filter matches the specified term (in this case, "Failed") and outputs a numeric metric. You then create a CloudWatch alarm that evaluates this custom metric and sends a notification to an Amazon SNS topic when the threshold is breached.
Adım Adım Çözüm
Anahtar Kavram
Using CloudWatch Logs Metric Filters and Alarms to detect and alert on log patterns.