arithmetric / lambda-stash

AWS Lambda script to ship data from S3 to other data stores, like Elasticsearch
MIT License
52 stars 18 forks source link

Adds support for Amazon Elastic Load Balancer (ELB) logs #23

Closed arithmetric closed 6 years ago

arithmetric commented 6 years ago

Adds support for Amazon Elastic Load Balancer (ELB) logs from Classic Load Balancer (using the formatELBv1 handler) or Application Load Balancer (using the formatELBv2 handler).

ELB access logs documentation:

An example implementation for parsing Classic Load Balancer logs and shipping them via TCP would use:

var shipper = require('lambda-stash');

exports.handler = function(event, context, callback) {
  var config = {
    tcp: {
      host: 'data.example.com',
      port: '10000'
    },
    string: {
      prefix: `token `,
    },
    mappings: [
      {
        bucket: 'elb-classic-logs',
        processors: [
          'parseSpaces',
          'formatELBv1',
          'convertString',
          'shipTcp'
        ],
      }
    ]
  };
  shipper.handler(config, event, context, callback);
};

Resolves #3.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 9306619fe702555bb640f8a4873b3f010102bfb3 on add_elb_support into edc99f1c1e44f047753b3530617b6795d3216306 on master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 9306619fe702555bb640f8a4873b3f010102bfb3 on add_elb_support into edc99f1c1e44f047753b3530617b6795d3216306 on master.