Hi Team, Is it possible to create CloudWatch alerts based on the error code from Oracle DB logs. Like trigger alert for ORA-XXX error from logs?
If the logs are in CloudWatch logs, then you can create a metric from the log stream and alert on that
Yes the are in CloudWatch logs. I have created some alerts based on existing cloudwatch matrics. Can you please point me how can I create matric from log stream? Thanks
Use a filter to match the specific pattern in your log https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringLogData.html and write this out to a CloudWatch metric. Then setup an alarm on the metric as you have done already.
Thanks it worked for me. Now I am trying to terraform it.
I have a quick question regarding patterns, I have few error code which I want them to check all in logs and alert.
Resource “aws_cloudwatch_log_metric_filter” “oralce_alarm_error” {
name = “int_oracle_error”
pattern = “rdshm”, “Thread 1 advanced to log sequence”
log_group_name = data.aws_cloudwatch_log_group.int_listener_log_group.name