Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CloudWatch Rule triggered by Log Event

I want to create CloudWatch Rule that would be triggered upon creation of Log Event. For that reason as an event pattern I selected CloudWatch Logs service but when I try to generate some Cloud Watch logs the rule is not getting triggered. I can not find any example of using aws.logs as a source for an event and hence my question if I'm doing something wrong. enter image description here

like image 462
user10664013 Avatar asked Oct 21 '25 07:10

user10664013


1 Answers

This is because the only events for logs available are AWS API Call via CloudTrail. CloudWatch Logs does not generate CloudWatch events on receiving new log entries.

For the Logs API call events to work, you need to setup CloudTrial trial.

However, if you want to trigger your lambda function based on log entries, I can recommend using subscription filters for lambda:

You can use subscriptions to get access to a real-time feed of log events from CloudWatch Logs and have it delivered to other services such as a Amazon Kinesis stream, Amazon Kinesis Data Firehose stream, or AWS Lambda for custom processing, analysis, or loading to other systems.

like image 141
Marcin Avatar answered Oct 24 '25 03:10

Marcin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!