Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Plugin which auto-subscribes a log delivery lambda function to lambda log groups
```yaml
plugins:
- serverless-plugin-cloudwatch-sumologic

custom:
shipLogs:
# Required
arn: existing cloudwatch logs ARN
# OR
collectorUrl: Paste your url from step 1. here

# Optional, default pattern is "[timestamp=*Z, request_id=\"*-*\", event]"
filterPattern: "[timestamp=*Z, request_id=\"*-*\", correlation_id=\"*-*\", event]"
# Optional. By default no pattern is specified.
filterPattern: "[log_level, timestamp=*Z, request_id=\"*-*\", correlation_id=\"*-*\", event]"
role: ARN of IAM role to use
```

Expand All @@ -37,6 +37,11 @@ Upon running `sls deploy` it will...
2. Permissions to Invoke the logging function, as a Resource.
3. Wait for the stack creation/update to complete and then delete the temporarily created function source directory.

# Upgrading

See [UPGRADING.md](https://github.com/ACloudGuru/serverless-plugin-cloudwatch-sumologic/blob/master/UPGRADING.md)
for information on upgrading from previous versions of the plugin.

# Caveats
You must be running serverless 1.25.0 or higher.

Expand Down
20 changes: 20 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Upgrading

## From < 0.1.0

* `filterPattern` used to default to `[timestamp=*Z, request_id=\"*-*\", event]`.
However, this was an unreliable default because some runtimes report in
different formats. See [issue #16](https://github.com/ACloudGuru/serverless-plugin-cloudwatch-sumologic/issues/16)
for more information.

To retain the prior behavior, you'll need to set the following `filterPattern`
value in your `serverless.yml` file.

```yaml
plugins:
- serverless-plugin-cloudwatch-sumologic

custom:
shipLogs:
filterPattern: "[timestamp=*Z, request_id=\"*-*\", event]"
```
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Plugin {
this.serverless.cli.log('Generating subscription filters');
const filterPattern = !!this.serverless.service.custom.shipLogs.filterPattern
? this.serverless.service.custom.shipLogs.filterPattern
: "[timestamp=*Z, request_id=\"*-*\", event]";
: "";
const principal = `logs.${this.serverless.service.provider.region}.amazonaws.com`;
const slsResources = this.serverless.service.provider.compiledCloudFormationTemplate.Resources;

Expand Down