This serverless app publishes AWS CloudWatch logs to another Lambda function based on a subscription filter. It does this by extracting the information from a CloudWatch log event and sending a JSON array of strings with information from the logs.
- Create an AWS account if you do not already have one and login
- Go to the app's page on the Serverless Application Repository and click "Deploy"
- Provide the required app parameters (see parameter details below) and click "Deploy"
Pass in a function name either as a reference parameter from another stack or resource or by supplying a name.
You can find the name of the log group by navigating to CloudWatch logs on the AWS console. You can also pass it in as a parameter from another stack or another resource (e.g. default lambda log group names are /aws/lambda/{lambda-function-name}
).
CloudWatch logs allow you to filter logs based on a pattern. For more information, see the AWS Documentation.
DestinationFunctionName
(required) - Name of the function to which this application will send log messagesLogGroupName
(required) - Log group to listen to (has to be in same account and region)FilterPattern
(optional) - Pattern for filtering log events. Default: ERRORLogLevel
(optional) - Log level for Lambda function logging, e.g., ERROR, INFO, DEBUG, etc. Default: INFO
LogsToLambdaName
- Lambda function name.LogsToLambdaArn
- Lambda function ARN.
This code is made available under the MIT license. See the LICENSE file.