Skip to main content
 首页 » 编程设计

python之我们可以在 python 中使用 boto3 获取 AWS Cloudtrail 日志吗

2025年01月19日8lvdongjie

有没有办法通过在 python 中使用 boto3 从 CloudTrail 获取日志/事件?如何?

请您参考如下方法:

您在控制台中看到的云轨迹事件可以使用云轨迹 boto3 api 查询

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

不过,建议在配置云轨迹的时候,开启日志并存储在S3中,这样您就可以查找历史云轨迹日志。

云跟踪日志将在 S3 中可用,可以使用 S3 api 访问/下载

希望这有帮助!!!