简体   繁体   中英

How to cleanup disk after sending logs to CloudWatch

Once logs are sent to CloudWatch using the CloudWatch client, we want to cleanup the disk. We have following 2 use cases.

  1. We don't login into some of the servers. We don't need to keep the logs on disk. So cleanup can happen immediately after sending logs to Server.
  2. On some servers, we want to keep logs for the last N days, after which these need to be deleted.

The Cloudwatch Logs Agent is compatible with logrotate, just make sure that you use one of the supported patterns.

See: CloudWatch Logs Agent Reference - Amazon CloudWatch Logs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM