-1

I have a problem in AWS regarding CloudWatch Log Triggers.

I have two Lambda functions. One (business-lambda) gets triggered when I upload a file to a S3 bucket. The other Lambda function (log-lambda) is triggered whenever business-lambda encounters an invalid file which results in creating an ERROR-log entry. I implemented this with a CloudWatch Log Trigger with filter "?ERROR" and having the log-lambda being subscribed to the log-group of the business-lambda.

Everything works fine as long as I upload one file at a time or at a maximum of ~3 files at a time.

But when I upload e.g. 10 invalid files at a time the log-lambda doesn't get triggered for all of the files. Instead it only gets triggered for 4-5 of them.

Is there some kind of "Cloudwatch-log-trigger/second" limit?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
mvmntjulz
  • 11
  • 2
  • What is your code? Maybe your lambda gets triggered for two log entries at the same time but you always only check the `[0]` record of the invoked event. – luk2302 Jul 29 '21 at 07:56
  • Can you tell us more about the 'invalid file' situation? Could the first Lambda function detect this and then take corrective action, or directly trigger the second function, rather than having to look through CloudWatch Logs? – John Rotenstein Jul 29 '21 at 08:06

1 Answers1

1

I found a solution - luk2302 made the correct suggestion in their comment.

In the log-lambda code I only process the first entry from an incoming log-event. But the log-lambda gets triggered once for multiple error-log entries from the business-lambda. I did not take this into account in the log-lambda code.

Thanks to everybody for their time!

mvmntjulz
  • 11
  • 2