CloudWatch Logs cost too high: ingestion, not storage, is the real culprit
When CloudWatch Logs costs too much, retention is the easy fix and ingestion is the real one. CloudWatch Logs bills ingestion per GB at write time and storage per GB-month, and in us-east-1 ingesting a gigabyte into the Standard log class costs more than storing it for a year (Amazon CloudWatch pricing, checked November 2026; read the rates for your region there).
Setting retention stops the storage line from growing. Retention does nothing about the ingestion line, and the ingestion line is usually made of logs nobody reads.
Why is my CloudWatch Logs bill so high?
CloudWatch Logs has two meters. Ingestion is charged once per GB at write time, on the uncompressed size, whether or not anyone ever queries the data. Storage is charged per GB-month on the compressed archive, for as long as retention allows. Retention changes how long the storage meter runs. Retention does not change how much you write, and how much you write is the ingestion line. Check which meter is bigger in your account before you pick a fix.
How do I find CloudWatch Logs charges in Cost Explorer?
In Cost Explorer, filter Service = CloudWatch and group by Usage type. Ingestion shows as <region>-DataProcessing-Bytes, for example USE1-DataProcessing-Bytes. Vended logs such as VPC Flow Logs show as <region>-VendedLog-Bytes. Storage shows as <region>-TimedStorage-ByteHrs. In the Cost and Usage Report (CUR), the same values are in line_item_usage_type under product code AmazonCloudWatch. Per-log-group rows need resource IDs enabled on the CUR export. With that on, this Athena query lists your most expensive log groups for the last 30 days:
SELECT
line_item_resource_id AS log_group,
line_item_usage_type,
ROUND(SUM(line_item_usage_amount), 1) AS gb,
ROUND(SUM(line_item_unblended_cost), 2) AS cost_usd
FROM cur_database.cur_table
WHERE line_item_product_code = 'AmazonCloudWatch'
AND (line_item_usage_type LIKE '%DataProcessing%'
OR line_item_usage_type LIKE '%VendedLog-Bytes')
AND line_item_usage_start_date >= CAST(current_date - INTERVAL '30' DAY AS timestamp)
GROUP BY 1, 2
ORDER BY cost_usd DESC
LIMIT 20;
To rank log groups without the CUR, open CloudWatch > Metrics > All metrics > Query and run this Metrics Insights query:
SELECT SUM(IncomingBytes) FROM SCHEMA("AWS/Logs", LogGroupName) GROUP BY LogGroupName ORDER BY SUM() DESC LIMIT 10
Metrics Insights covers a limited recent window. Use it to find candidates, then confirm a full week for any one group with the CLI:
aws cloudwatch get-metric-statistics --namespace AWS/Logs --metric-name IncomingBytes \
--dimensions Name=LogGroupName,Value=/aws/lambda/my-function \
--start-time 2026-11-05T00:00:00Z --end-time 2026-11-12T00:00:00Z \
--period 86400 --statistics Sum
Check your own bill in 2 minutes: https://revelations.consulting/checker?utm_source=blog&utm_medium=organic&utm_content=blog-cloudwatch-logs-cost-too-high
How do I cut CloudWatch Logs costs without breaking anything?
Check dependencies before you change anything. A metric filter only matches new events. If you lower a log level or filter out lines, an alarm built on that filter can stop firing without any error. A subscription filter streams the log group to Kinesis Data Streams, Amazon Data Firehose or Lambda (the console's OpenSearch option creates a Lambda function), which is often how Datadog, Splunk or a SIEM gets its data.
aws logs describe-metric-filters --log-group-name /aws/lambda/my-function
aws logs describe-subscription-filters --log-group-name /aws/lambda/my-function
aws cloudwatch describe-alarms-for-metric --namespace MyApp --metric-name ErrorCount
Run the alarm lookup for each metric filter's namespace and metric name. Check compliance too. PCI DSS requires a year of audit log history, with the last three months immediately available. Your SOC 2 or HIPAA policies may set their own retention periods. Make one change at a time, in staging first, and watch the affected alarms for a day.
Retention is the quick fix for the storage line. The Infrequent Access log class in step 1 lowers the ingestion price, and steps 2 to 4 cut ingestion volume.
1. Set a retention period on every log group. New log groups default to Never expire. List the ones with no retention:
aws logs describe-log-groups --query 'logGroups[?!retentionInDays].logGroupName' --output text
Retention deletes events older than the period you set, and you cannot get them back. Export anything you must keep to S3 first with aws logs create-export-task. Then apply a period that matches your policy:
aws logs put-retention-policy --log-group-name /aws/lambda/my-function --retention-in-days 30
For logs you write for audit and rarely query, the Infrequent Access log class halves the ingestion price. Compare the Infrequent Access and Standard ingestion rates for your region on the Amazon CloudWatch pricing page (checked November 2026); both classes pay the same storage rate. The log class is set when a log group is created and cannot be changed later. To use it, create a new group, set its retention, and point the writer at it. Infrequent Access does not support metric filters, subscription filters, Live Tail or embedded metric format, so use it only for groups nothing reads in real time. Keep the function's current LogFormat (the example assumes Text) and check that the function's IAM role can write to the new group:
aws logs create-log-group --log-group-name /aws/lambda-ia/my-function --log-group-class INFREQUENT_ACCESS
aws lambda update-function-configuration --function-name my-function \
--logging-config LogFormat=Text,LogGroup=/aws/lambda-ia/my-function
2. Stop logging debug-level messages in production. Debug logging often gets switched on during an incident and never switched off. Compare a log group's IncomingBytes before and after the change to see what DEBUG was costing you. Set the level in your application configuration. For example, in a Spring Boot application.yml:
logging:
level:
com.yourcompany: INFO
org.springframework: WARN
In Node.js, set the level option of pino or winston to info; many apps read it from a LOG_LEVEL environment variable. In Python’s logging module, use logging.basicConfig(level=logging.INFO). For Lambda, filter at the platform. Lambda's log-level controls require the JSON log format. Switching a function from text to JSON changes every log line, so update any metric filter patterns on that log group first:
aws lambda update-function-configuration --function-name my-function \
--logging-config LogFormat=JSON,ApplicationLogLevel=INFO,SystemLogLevel=WARN
3. Filter out health checks and load balancer noise. ALB and NLB access logs go to S3, not CloudWatch Logs, so they are not on this bill. The noise that does reach CloudWatch is your application or ingress controller logging every health-check request: ALB health checks arrive with the user agent ELB-HealthChecker/2.0, and Kubernetes probes hit paths like /healthz. Skip those requests in your access-log middleware. You can also drop them in the log shipper, for example with Fluent Bit:
[FILTER]
Name grep
Match *
Exclude log (ELB-HealthChecker|/healthz)
This filter drops every line that mentions those strings, including errors from a failing health endpoint. Narrow Match to your application's tag and test it in staging first.
# (end of example)
4. Don’t log full request bodies or headers. Logging POST bodies, Authorization headers or cookies adds the full payload to every line you ingest and puts credentials in your logs. Find them with a Logs Insights query such as fields @message | filter @message like /Authorization|Cookie|password/ | limit 20, then log only the fields you need:
{
"level": "info",
"method": "POST",
"path": "/api/v1/users",
"status": 200,
"duration_ms": 42,
"user_id": "123",
"ip": "192.0.2.1"
}
What it usually looks like
You’ll typically see one or more of these patterns:
- A Lambda function's log group tops the IncomingBytes list because the function logs every HTTP request at
DEBUGlevel. - EKS control plane logging has the
auditlog type turned on, and/aws/eks/<cluster-name>/clustersits near the top of the IncomingBytes list. Check which log types are on withaws eks describe-cluster --name <cluster-name> --query cluster.logging. - VPC Flow Logs were sent to CloudWatch Logs for one investigation and never turned off; look for
VendedLog-Bytesin Cost Explorer. - API Gateway execution logging is set to INFO with full request and response data logged, which writes every payload to an
API-Gateway-Execution-Logs_<api-id>/<stage>log group. - A legacy application logs full SQL queries with parameters, which puts its log group near the top of the IncomingBytes list and puts customer data in your logs.
- A cron job dumps the entire contents of a config file into logs every few minutes, even when no changes occur.
At a former employer, I cut a roughly $1M-a-year cloud bill by 26%. Log ingestion is worth checking early on any bill, because IncomingBytes makes it quick to measure.
CloudWatch Logs costs climb when you write too much, not only when you keep too long. This week, pull your top ten log groups by IncomingBytes and check each one for metric filters and subscriptions. Then turn down debug logging and filter health checks on the biggest group. Set retention on every Never expire group once your compliance owner signs off. If you want a second pair of eyes on the rest of the bill, a senior engineer will go through it with you.
Get a free 30-minute review of your cloud and AI bill: https://revelations.consulting/?utm_source=blog&utm_medium=organic&utm_content=blog-cloudwatch-logs-cost-too-high#contact
Frequently asked questions
How do I know if my CloudWatch Logs cost is from ingestion or storage?
Group CloudWatch spend by usage type in Cost Explorer or the Cost and Usage Report. DataProcessing-Bytes and VendedLog-Bytes are CloudWatch Logs ingestion and TimedStorage-ByteHrs is CloudWatch Logs storage; whichever line costs more is where to start.
What’s the cheapest way to keep CloudWatch Logs longer than 90 days?
Export older CloudWatch Logs data to S3 with aws logs create-export-task, add an S3 lifecycle rule that moves it to a Glacier storage class, and set the log group's retention to match how far back you actually query. The CloudWatch Logs Infrequent Access log class lowers the ingestion price, not the storage price, and can only be chosen when a log group is created.
Can I use S3 instead of CloudWatch Logs for application logs?
Yes. Fluent Bit's S3 output or the AWS Distro for OpenTelemetry S3 exporter can send application logs straight to S3, and Athena can query them there. Logs in S3 lose CloudWatch Logs Insights, metric filters, alarms and Live Tail, so keep anything you alert on in CloudWatch.
Do ALB access logs count toward my CloudWatch Logs bill?
No. Application Load Balancer access logs are off by default and are written to an S3 bucket you choose, so they show up as S3 charges, not CloudWatch Logs charges. ALB health checks can still raise CloudWatch Logs ingestion when your application or ingress controller logs every request from the ELB-HealthChecker user agent.
How do I find which Lambda function is writing the most logs?
Run the Metrics Insights query SELECT SUM(IncomingBytes) FROM SCHEMA("AWS/Logs", LogGroupName) GROUP BY LogGroupName ORDER BY SUM() DESC under CloudWatch > Metrics > All metrics > Query and read the /aws/lambda/ rows. For a longer window, filter the Cost and Usage Report on line_item_resource_id LIKE '%log-group:/aws/lambda/%' and on both the DataProcessing-Bytes and VendedLog-Bytes usage types.
Want this kind of thing weekly? Get Cloud Bill Weekly. Want us to find it in your bill? We're taking three founding clients for a free Cost Assessment.