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

Event did not match any mappings. #14

Closed raccoon4me closed 7 years ago

raccoon4me commented 7 years ago

I got the following template to push cloudtrail logs stored in S3 to ES.

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

exports.handler = function(event, context, callback) {
var config = {
  elasticsearch: {
    host: 'https://my-elastic-search-endpoint.es.amazonaws.com',
    region: 'us-east-1',
    useAWS: true
  },
  mappings: [
    {
      bucket: 'my-bucket-name',
      processors: [
        'decompressGzip',
        'parseJson',
        'formatCloudtrail',
        'shipElasticsearch'
      ],
      elasticsearch: {
        index: 'logs',
        type: 'cloudtrail'
      },
      dateField: 'date'
    }
  ]
};
  shipper.handler(config, event, context, callback);
};

But all i got in CLoudwatch logs is:

Task timed out after 3.00 seconds 

Am i missing something ?

Thanks a lot :)

raccoon4me commented 7 years ago

Fixed by setting timeout to 1min