Skip to content

How do I troubleshoot CloudWatch log event ingestion and visibility issues across different services?

2 minute read
0

I want to resolve data delivery delays that I experience when experience delays when retrieving log events from Amazon CloudWatch Logs.

Short description

Recently ingested events and updated metadata may not appear immediately in API responses, because CloudWatch Logs operates on an eventual consistency model. However, the events and metadata appear in queries that you make later.

The following log events and log stream metadata don't immediately update when Amazon CloudWatch ingests them:

  • The lastEventTimestamp field in the DescribeLogStreams response doesn't detect new log events.
  • CloudWatch Logs API operations, such as GetLogEvents, FilterLogEvents, DescribeLogStreams, and StartQuery, don't return recently ingested events or updated metadata when you call them after you ingest events.
  • Consecutive API calls within short intervals can return incomplete results. For example, a short interval of 5 minutes can return incomplete results.

For real-time log processing and immediate delivery, use CloudWatch Logs subscription filters. You can also use filter patterns to reduce the volume of data forwarded to downstream services. For more information, see Real-time processing of log data with subscriptions.

Resolution

You can create subscription filters for log groups, or individual AWS accounts.

Take one of the following actions to create a log group-level subscription filter, based on your destination resource:

Take one of the following actions to create an account-level subscription filter, based on your destination resource:

To receive their log events from the owner of a different account on your AWS resources, see Cross-account cross-Region subscriptions.

Related information

CloudWatch Logs API Reference

CloudWatch Logs examples using SDK for Java 2.x