CloudWatchLogs.filter_log_events nextToken is not null but there are no results #4258
Labels
bug
This issue is a confirmed bug.
closed-for-staleness
cloudwatchlogs
p2
This is a standard priority issue
response-requested
Waiting on additional information or feedback.
Describe the bug
When calling
filter_log_events
using CloudWatchLogs client, thenextToken
key is always coming with a token instead ofnull
even though there are no results.Expected Behavior
nextToken
should be null whenevents
is empty.Current Behavior
events
returns an empty list butnextToken
is not nullReproduction Steps
filter_log_events
withlogGroupName, filterPattern, startTime, endTime
nextToken
.Possible Solution
I don't have a possible solution but a workaround could be to also check the results if that is empty, just ignore the nextToken
Additional Information/Context
The odd thing is that this is only happening with one AWS account so far.
To do the filtering, we first call
describe_log_groups
to get the list of log groups and then perform the filtering for each group.Here are the some of the arguments I used:
And here some actual responses from the
filter_log_events
First call
Second call
SDK version used
boto3==1.34.80
Environment details (OS name and version, etc.)
MacOS Sonoma 14.6.1 (23G93), Ubuntu 22.04 docker image
The text was updated successfully, but these errors were encountered: