Gathering detailed insights and metrics for serverless-logstreaming-plugin
Gathering detailed insights and metrics for serverless-logstreaming-plugin
Gathering detailed insights and metrics for serverless-logstreaming-plugin
Gathering detailed insights and metrics for serverless-logstreaming-plugin
npm install serverless-logstreaming-plugin
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
14 Commits
3 Forks
1 Branches
1 Contributors
Updated on Jul 15, 2019
Latest Version
0.1.4
Package Id
serverless-logstreaming-plugin@0.1.4
Size
4.22 kB
NPM Version
3.10.6
Node Version
4.4.7
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
18
This plugin will automatically configure your CloudWatch logs to stream to one of the Lambda functions in your project.
This plugin was motivated by a desire to consolidate CloudWatch logs in a service like Loggly. However, by Streaming your logs to a lambda, you can do any sort of aggregation or metrics on your logs you'd like.
Note: Requires Serverless v0.5.0.
The plugin requires a custom setting in s-project.json
1{ 2 "custom": { 3 "logStreaming": { 4 "functionName": "logStreaming" 5 } 6 } 7}
This will be a reference to the function you'll write to receive the log streams. This function will be deployed just like any other
in your project. The serverless-logstreaming-plugin
will configure the CloudWatch logs for all of your other functions to stream
log events to this function.
Your log streaming function will receive events that are shaped like this:
1{ 2 "awslogs": { 3 "data": "H4sIAAAAAAAAAM2ZW2/bRhCF/4qghz7Z0s7s7E1AUDiwkxefBmeLv+MEhwWWwcunuJr9NdiOvKoi5g6huZ72f3HzD1Bi9GuWGwAA" 4 } 5}
The data
property is a gzipped JSON object containing one or more log events. You can decode the data like this:
1const compressedBuffer = new Buffer(event.awslogs.data, "base64"); 2const decompressedBuffer = await gunzip(compressedBuffer); 3const data = JSON.parse(decompressedBuffer.toString());
The decompressed data will look like this:
1{ 2 "messageType": "DATA_MESSAGE", 3 "owner": "478975653623", 4 "logGroup": "/aws/lambda/myFunction", 5 "logStream": "2016/06/30/[26]e82a72c762484f97ae64789d2e5b7dee", 6 "subscriptionFilters": [ 7 "yourLoggingFunctionName" 8 ], 9 "logEvents": [ 10 { 11 "id": "32722257877424071767718648969301946065457340266792681472", 12 "timestamp": 1467316790812, 13 "message": "2016-06-30T19:59:50.812Z\t345da8e6-3efd-11e6-afb7-85911a72ebf4\tA log message from one of your executing Lambdas" 14 } 15 ] 16}
npm install serverless-logstreaming-plugin --save-dev
plugins
array in your Serverless Project's s-project.json
, like this:plugins: [
"serverless-logstreaming-plugin"
]
Now, any time you deploy a function to AWS, serverless-logstreaming-plugin
will automatically configure the Lambda's CloudWatch logs to send events to the
function you specified in your s-project.json.
serverless-logstreaming-plugin
also includes a command that will fix the CloudWatch Log configuration for all of your lambdas, if it's ever necessary.
Just run sls logStreaming fix
, and the plugin will configure CloudWatch log groups for all of your lambdas. If you have more than one stage configured, you may need to provide
the -s <stage>
and/or -r <region
options.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 1/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More