amazon-web-services - 是否可以将日志从 EC2 实例自动导出到 S3 存储桶?
问题描述
我希望日志在生成后立即保存到 S3 存储桶中。
从我读过的内容来看,似乎可以通过 Cloudwatch 从 EC2 导出到 S3,但在尝试后,导出似乎是用“开始”日期和“结束”日期修复的。
还有其他方法可以将我的日志保存在 S3 存储桶上吗?
解决方案
You can create a role with permission to write to certain bucket, than assign this role to EC2 instance. Then you will be able to export logs from ec2 instance directly to S3 using s3 api. You can write a shell script exporting logs and run it as cron job.
推荐阅读
- kotlin - Kotlin 脚本构建失败
- bazel - Monorepo 与多个连接的 Bazel 工作区 - 是否有任何“陷阱”需要考虑?
- dependency-injection - blazor wasm 如何从 di 注入自定义类
- java - jar 未正确创建 mvn relase
- python - 如何使用 ctypes 从 Python 创建 C 结构?
- json - Swift/JSONEncoder:包含嵌套原始 JSON 对象文字的编码类
- c - 运行程序后imac死机
- python - 从网站提取数据时如何绕过验证码。我从 https://jp.indeed.com/ 中提取
- sensors - ESP32 模数 ADC
- html - 将鼠标悬停在我的卡片上并不能覆盖完整的卡片