- Newest
- Most votes
- Most comments
Hello,
We understand that some log events are missing in the result returned by FilterLogEvents API with Go SDK.
FilterLogEvents can return empty results while there are more log events available through the token. However, kindly ensure to specify the input parameters StartTime, EndTime, LogStreamNamePrefix/LogStreamNames and LogGroupName for faster/accurate log retrieval.
Workarounds:
-
You can use DescribeLogStreams API call with orderBy LastEventTime and then use FilterLogEvents API call on each of the log streams returned.
[+] AWS SDK for Go API Reference - DescribeLogStreams
https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatchlogs/#CloudWatchLogs.DescribeLogStreams
-
You can also consider using CloudWatch Log Insights to filter log events
[+] CloudWatch Log Insights - https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html
For dedicated troubleshooting and resolution, kindly contact AWS Premium Support via a technical support case.
[+] AWS Support - https://aws.amazon.com/premiumsupport/
Relevant content
- AWS OFFICIALUpdated 7 months ago
Thanks, I will likely go via insights route. Log Insights does return the missing event. In my case, when I FilterLogEvents, with tight time range, I get my event, but when I widen time range, even by 1ms, the event disappears. Using DescribeLogStreams is tricky, because eventbridge creates log streams on the fly, as events get routed into the log group, I fear the inconsistencies between call to DescribeLogStreams and to FilterLogEvents might introduce other problems. I assume you suggest that loading from stream (or specifying list of streams) does not exhibit the same issue. Thanks again.