Why it matters
Ingestion is usually the largest part of a CloudWatch Logs bill, and many log groups are kept only in case they are needed for an investigation.How nOps finds it
nOps reads your CloudWatch Logs billing for each log group. A group is flagged when it ingested Standard-class data on at least 7 of the last 14 days. Groups whose Logs Insights query cost in the last 30 days was more than 2% of their ingestion cost are left out, because they are queried often. The saving is the ingestion cost of the last 7 days, scaled to a month, times the difference between the public Standard and Infrequent Access prices per GB in the region, and must be at least $20 a month.Before you start
Know which features the log group relies on, and who produces and reads its logs.How to implement
- Check the log group does not need features Infrequent Access drops: metric filters, subscription filters, Live Tail, embedded metric format extraction, anomaly detection and data protection.
- Create a new log group with the Infrequent Access class (
aws logs create-log-group --log-group-name NEW_NAME --log-group-class INFREQUENT_ACCESS) and set its retention. - Point the producers (applications, Lambda functions, agents) at the new group.
- Keep the old group until its data expires or is no longer needed, then delete it.
Risks and considerations
- The log class is fixed when a log group is created, so this means a new log group and a change for every producer.
- Logs Insights queries still work on Infrequent Access, but alarms built on metric filters do not.
- To roll back, point producers back at a Standard log group.
FAQs
Can I change the class of an existing log group?
Can I change the class of an existing log group?
No. The class is set when the group is created, so you create a new group and move the producers.