https://github.com/tsub/serverless-plugin-subscription-filter
Extend subscription filter events for the Serverless framework :zap:
https://github.com/tsub/serverless-plugin-subscription-filter
aws aws-lambda nodejs serverless serverless-plugin
Last synced: 2 months ago
JSON representation
Extend subscription filter events for the Serverless framework :zap:
- Host: GitHub
- URL: https://github.com/tsub/serverless-plugin-subscription-filter
- Owner: tsub
- License: mit
- Created: 2016-11-28T07:19:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-05T06:49:58.000Z (over 1 year ago)
- Last Synced: 2025-10-08T10:48:44.781Z (6 months ago)
- Topics: aws, aws-lambda, nodejs, serverless, serverless-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/serverless-plugin-subscription-filter
- Size: 626 KB
- Stars: 19
- Watchers: 2
- Forks: 5
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# serverless-plugin-subscription-filter
[](http://www.serverless.com) [](https://badge.fury.io/js/serverless-plugin-subscription-filter)
Serverless plugin to register AWS CloudWatchLogs subscription filter.
## Installation
`npm install --save-dev serverless-plugin-subscription-filter`
```yaml
plugins:
- serverless-plugin-subscription-filter
```
## Usage
This plugin is external serverless events.
You can write settings like serverless events.
```yaml
functions:
hello:
handler: handler.hello
events:
- subscriptionFilter:
stage: prod
logGroupName: /cloud-trail
filterPattern: '{ $.errorMessage != "" }'
```
Supports also multiple subscription filter.
```yaml
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: Exception
```
### About 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).|