dev
dev

Reputation: 981

Process Daily Logs from Cloudwatch using lambda

I dont have much code to show.

I want to process all cloudwatch logs that are generated in last 1 day using lambda. I want to execute lambda 6 am in the morning to extract some information from cloudwatch logs that are generated on previous day and put it in a table.

Upvotes: 1

Views: 656

Answers (2)

Binh Nguyen
Binh Nguyen

Reputation: 2157

I assume that you have a lot of Lambda functions and each has a CloudWatch Log Group.

You can try the CloudWatch Log Group subscription filter, with this feature you can stream your logs into any support destinations such as Lambda.

cwlogs-subscription-filter-lambda

Before that, you should prepare a Lambda function that has functionalities to help you to put your extracted data into DynamoDB table.

References:

Upvotes: 0

Chris
Chris

Reputation: 266

Instead of your 6 AM idea, you could also use a CloudWatch Logs subscription filter and trigger a Lambda function to process and store the log entries as described in a step-by-step example here Example 2: Subscription filters with AWS Lambda.

Or even easier and without duplicating the data to a database: Analyzing log data with CloudWatch Logs Insights

Upvotes: 1

Related Questions