Skip to content

Commit ce7b72b

Browse files
committed
Adding example implementation.
1 parent a8c55aa commit ce7b72b

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

example/index.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
var shipper = require('lambda-stash');
2+
3+
exports.handler = function(event, context, callback) {
4+
var config = {
5+
elasticsearch: {
6+
host: 'https://search-abcdefghi.us-west-2.es.amazonaws.com',
7+
index: 'logs',
8+
region: 'us-west-2',
9+
useAWS: true
10+
},
11+
mappings: [
12+
{
13+
bucket: 'my-cloudtrail-logs',
14+
processors: [
15+
'decompressGzip',
16+
'parseJson',
17+
'formatCloudtrail',
18+
'shipElasticsearch'
19+
],
20+
elasticsearch: {
21+
type: 'cloudtrail'
22+
},
23+
dateField: 'date'
24+
},
25+
{
26+
bucket: 'my-cloudfront-logs',
27+
processors: [
28+
'decompressGzip',
29+
'parseTabs',
30+
'formatCloudfront',
31+
'shipElasticsearch'
32+
],
33+
elasticsearch: {
34+
type: 'cloudfront'
35+
},
36+
dateField: 'date'
37+
}
38+
]
39+
};
40+
shipper.handler(config, event, context, callback);
41+
};

example/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "lambda-stash-example",
3+
"version": "1.0.0",
4+
"description": "Example deployment package for lambda-stash to AWS Lambda.",
5+
"main": "index.js",
6+
"dependencies": {
7+
"lambda-stash": "*"
8+
},
9+
"private": true
10+
}

0 commit comments

Comments
 (0)