Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bragg-cloudwatch-log

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bragg-cloudwatch-log

Bragg middleware to handle CloudWatch Logs events

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bragg-cloudwatch-log Build Status

bragg Bragg middleware to process CloudWatch Logs events

Install

$ npm install bragg-cloudwatch-log

Usage

All the events will be routed to post cloudwatch:log. You can use that route to handle the CloudWatch log events.

const app = require('bragg')();
const router = require('bragg-router')();
const cloudWatchLog = require('bragg-cloudwatch-log');

// Listen for CloudWatch Log events
router.post('cloudwatch:log', ctx => {
	/**
	 * {
	 *		"messageType": "DATA_MESSAGE",
	 *		"owner": "123456789012",
	 *		"logGroup": "/aws/lambda/echo-nodejs",
	 *		"logStream": "2019/03/13/[$LATEST]94fa867e5374431291a7fc14e2f56ae7",
	 *		"subscriptionFilters": [
	 *			"LambdaStream_cloudwatchlogs-node"
	 *		],
	 *		"logEvents": [
	 *			{
	 *				"id": "34622316099697884706540976068822859012661220141643892546",
	 *				"timestamp": 1552518348220,
	 *				"message": "REPORT RequestId: 6234bffe-149a-b642-81ff-2e8e376d8aff\tDuration: 46.84 ms\tBilled Duration: 100 ms \tMemory Size: 192 MB\tMax Memory Used: 72 MB\t\n"
	 *			}
	 *		]
	 *	}
	 */
    console.log(ctx.request.body)
});

app.use(cloudWatchLog());
app.use(router.routes());

exports.handler = app.listen();

API

cloudWatchLog()

Add the bragg CloudWatch Log middleware to the middleware pipeline.

License

MIT © Simon

Keywords

FAQs

Package last updated on 12 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc