aws-samples / amazon-elasticsearch-lambda-samples

Data ingestion for Amazon Elasticsearch Service from S3 and Amazon Kinesis, using AWS Lambda: Sample code
MIT No Attribution
391 stars 173 forks source link

CloudTrial to ElasticSearch #16

Open johnakash opened 7 years ago

johnakash commented 7 years ago

Hi Team,

We having nearly 20 AWS accounts and we centralised CloudTrail logs to a single management account. We have a custom build ElasticSearch (5.6) in the EC2 in the same account.

Now we are trying to push all CloudTrail data from S3 bucket to ES (with put object as event trigger for lambda) using a lambda function. When using this we are facing some challenges while pushing the data to ES.

While going through lambda logs it is identified that some event response data (in json) is not maintaining proper structures. We are using python codes in lambda functions

Could you please help us to find a way to put all the CloudTrail events to ElasticSearch with out any failure.

pacohope commented 5 years ago

I realise this is a year-old question. But if the goal is getting CloudTrail into ElasticSearch, this Lambda function is probably not the way you want to do it. The documentation on CloudTrail talks about how you get CloudTrail going to CloudWatch Logs. Then, CloudWatch Logs can stream directly to ElasticSearch. You don't have to send the CloudTrial to S3 (unless you want to) and you don't have to use Lambda.