FCoding
FCoding

Reputation: 121

Can we fetch AWS Cloudtrail logs using boto3 in python?

Is there a way to get logs/events from CloudTrail by using boto3 in python? How?

Upvotes: 3

Views: 8885

Answers (1)

omuthu
omuthu

Reputation: 6333

Cloud trail events which you see in console can be queried using cloud trail boto3 api

Ref : http://boto3.readthedocs.io/en/latest/reference/services/cloudtrail.html#CloudTrail.Client.lookup_events

However, it is advisable to enable logs and store in S3 while configuring cloud trail so that you can look for historical cloud trail logs.

Cloud trail logs will be available in S3 which can accessed/downloaded using S3 apis

Hope this helps !!!

Upvotes: 2

Related Questions