Skip to content

Commit

Permalink
Merge branch 'gadouryd-master' for PR 12
Browse files Browse the repository at this point in the history
  • Loading branch information
duchatran committed Jul 11, 2016
2 parents 9ee41b0 + 8a53d27 commit 99cd32e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
20 changes: 12 additions & 8 deletions cloudwatchlogs/cloudwatchlogs.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Remember to change the hostname and path to match your collection API and specific HTTP-source endpoint
// See more at: https://service.sumologic.com/help/Default.htm#Collector_Management_API.htm
///////////////////////////////////////////////////////////////////////////////////////////////////////////
var sumoEndpoint = 'https://collectors.sumologic.com/receiver/v1/http/<XXX>'

var https = require('https');
var zlib = require('zlib');
var url = require('url');

exports.handler = function(event, context) {
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Remember to change the hostname and path to match your collection API and specific HTTP-source endpoint
// See more at: https://service.sumologic.com/help/Default.htm#Collector_Management_API.htm
///////////////////////////////////////////////////////////////////////////////////////////////////////////
var options = { 'hostname': 'collectors.sumologic.com',
'path': 'https://collectors.sumologic.com/receiver/v1/http/<XXX>',
'method': 'POST'
};
var urlObject = url.parse(sumoEndpoint);

var options = { 'hostname': urlObject.hostname,
'path': urlObject.pathname,
'method': 'POST'
};
var zippedInput = new Buffer(event.awslogs.data, 'base64');

zlib.gunzip(zippedInput, function(e, buffer) {
Expand Down
23 changes: 14 additions & 9 deletions cloudwatchlogs/cloudwatchlogs_lambda.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Remember to change the hostname and path to match your collection API and specific HTTP-source endpoint
// See more at: https://service.sumologic.com/help/Default.htm#Collector_Management_API.htm
///////////////////////////////////////////////////////////////////////////////////////////////////////////
var sumoEndpoint = 'https://collectors.sumologic.com/receiver/v1/http/<XXX>'

var https = require('https');
var zlib = require('zlib');
var url = require('url');

exports.handler = function(event, context) {
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Remember to change the hostname and path to match your collection API and specific HTTP-source endpoint
// See more at: https://service.sumologic.com/help/Default.htm#Collector_Management_API.htm
///////////////////////////////////////////////////////////////////////////////////////////////////////////
var options = {
'hostname': 'collectors.sumologic.com',
'path': 'https://collectors.sumologic.com/receiver/v1/http/<XXX>',
'method': 'POST'
};
var urlObject = url.parse(sumoEndpoint);

var options = { 'hostname': urlobject.hostname,
'path': urlObject.pathname,
'method': 'POST'
};

var zippedInput = new Buffer(event.awslogs.data, 'base64');

zlib.gunzip(zippedInput, function(e, buffer) {
Expand Down

0 comments on commit 99cd32e

Please sign in to comment.