Package Exports
- btin-serverless-plugin-subscription-filter
- btin-serverless-plugin-subscription-filter/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (btin-serverless-plugin-subscription-filter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
serverless-plugin-subscription-filter
Serverless plugin to register AWS CloudWatchLogs subscription filter.
Installation
npm install --save-dev serverless-plugin-subscription-filter
plugins:
- serverless-plugin-subscription-filterUsage
This plugin is external serverless events. You can write settings like serverless events.
functions:
hello:
handler: handler.hello
events:
- subscriptionFilter:
stage: prod
logGroupName: /cloud-trail
filterPattern: '{ $.errorMessage != "" }'Supports also multiple subscription filter.
functions:
hello:
handler: handler.hello
events:
- subscriptionFilter:
stage: prod
logGroupName: /cloud-trail
filterPattern: '{ $.errorMessage != "" }'
- subscriptionFilter:
stage: prod
logGroupName: /my-log-group
filterPattern: '{ $.errorMessage != "" }'
goodbye:
handler: handler.goodbye
events:
- subscriptionFilter:
stage: dev
logGroupName: /my-log-group2
filterPattern: ExceptionAbout each properties
| property | description |
|---|---|
| stage | The deployment stage with serverless. Because only one subscription filter can be set for one LogGroup. |
| logGroupName | The log group to associate with the subscription filter. |
| filterPattern | The filtering expressions that restrict what gets delivered to the destination AWS resource. Sorry, if you want to use '{ $.xxx = "yyy" }' syntax, then surround the whole in ''(single quote). |