- Newest
- Most votes
- Most comments
To add a modern alternative for those looking to manage log costs and complex querying:
While standard Trails have the filtering limitations mentioned, consider AWS CloudTrail Lake.
Unlike standard S3-backed trails, CloudTrail Lake allows you to use SQL-based ingestion filters. This means you can technically exclude specific errorCode values or specific users/roles at the point of ingestion into the data lake. This helps in:
- Reducing "noise" before the data is even stored for analysis.
- Cost Management: You only pay for the storage of events that meet your specific criteria.
If you are sticking with standard S3/CloudWatch logs, then filtering at the EventBridge or Athena level (as suggested above) remains the industry-standard approach.
The trail is ingested into monitoring platform (eG), what is the most cost-optimized architecture to filter CloudTrail events before forwarding? Is there a known baseline or categorization of CloudTrail events into: Security-critical Operational risk-related Noise/transient?
You can’t exclude them directly in CloudTrail trail settings — CloudTrail doesn’t support filtering specific error codes at the source level.
What I usually do instead is keep the trail as-is (for audit purposes) and handle the noise later.
If logs are going to CloudWatch, you can filter them there and ignore events where errorCode = Client.DryRunOperation so they don’t affect alerts.
If you’re using Athena or any log analysis, just exclude them in your queries — that’s usually the easiest and most flexible approach.
For alerts (EventBridge rules), you can add a condition to skip these events so they don’t trigger notifications.
Basically, instead of trying to stop CloudTrail from collecting them (which isn’t possible), it’s better to filter them where you actually consume the logs.
References:
CloudTrail filtering and event structure: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html CloudWatch Logs filter patterns: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html EventBridge event patterns: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html
Relevant content
- asked 3 years ago
- asked 3 years ago
- asked 4 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago

If my answer helped solve your problem, I would appreciate it if you click on “accepted answer”