[export-log] Fix false "No log events in the log group" error on log export - #7571
Open
hanwen-cluster wants to merge 1 commit into
Open
[export-log] Fix false "No log events in the log group" error on log export#7571hanwen-cluster wants to merge 1 commit into
hanwen-cluster wants to merge 1 commit into
Conversation
…export Prior to this commit, validation error of "no log events" is triggered whenever the first FilterLogEvents call came back with an empty events list. FilterLogEvents is paginated, so a page can be empty even when if more data is available in the next pages. This commit triggers the validation error only if both events list and `nextTokens` are empty
hanwen-cluster
commented
Aug 19, 2026
| kwargs["endTime"] = end_time | ||
| if log_stream_name_prefix: | ||
| kwargs["logStreamNamePrefix"] = log_stream_name_prefix | ||
| return self._client.filter_log_events(**kwargs).get("events") |
Contributor
Author
There was a problem hiding this comment.
The return value of the function has to be changed, so the caller of this function has info on both event list and nextToken
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Prior to this commit, validation error of "no log events" is triggered whenever the first FilterLogEvents call came back with an empty events list. FilterLogEvents is paginated, so a page can be empty even when if more data is available in the next pages.
This commit triggers the validation error only if both events list and
nextTokensare empty. Even though the existence ofnextTokensdoesn't guarantee the log is non-empty, this commit still makes a single API call for validationTests
Manually tested the following:
--start-time 2026-08-12T00:00:00Z --end-time 2026-08-20T00:00:00Z. Logs are successfully exported. This was the case where the "no log events" error was falsely reported--start-time 2026-08-12T00:00:00Z --end-time 2026-08-18T00:00:00Z, "no log events" error was correctly reportedReferences
Checklist
developadd the branch name as prefix in the PR title (e.g.[release-3.6]).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.