Skip to content

Instantly share code, notes, and snippets.

View aussiearef's full-sized avatar

Aref Karimi aussiearef

View GitHub Profile
@aussiearef
aussiearef / aws-stream-logs-from-cloudwatch-lambda-es--lambda-code.js
Created January 2, 2019 11:40 — forked from torgeir/aws-stream-logs-from-cloudwatch-lambda-es--lambda-code.js
AWS stream logs from "cloudwatch -> lambda -> es" node.js lambda-code
// v1.1.2
var https = require('https');
var zlib = require('zlib');
var crypto = require('crypto');
var endpoint = '<aws es endpoint>';
exports.handler = function(input, context) {
// decode input from base64
var zippedInput = new Buffer(input.awslogs.data, 'base64');