mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(logs): reject filtering nonexistent log groups (#6372)
Check the scoped log group before parsing a FilterLogEvents pattern. Reuse the missing-group error and cover missing, deleted, empty and populated groups through service and SDK tests. Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
1 parent
2cda0110a6
commit
f50a698ab7
3 files changed
+116
No files matched your search
+4
@@ -980,6 +980,10 @@ public class CloudWatchLogsService implements ResourceProvider, Resettable {
|
||||
Long startTime, Long endTime,
|
||||
String filterPattern, int limit,
|
||||
String nextToken, String region) {
|
||||
groupStore.get(groupKey(region, groupName))
|
||||
.filter(stored -> groupName.equals(stored.getLogGroupName()))
|
||||
.orElseThrow(CloudWatchLogsService::logGroupNotFound);
|
||||
|
||||
int maxEvents = Math.min(limit > 0 ? limit : Integer.MAX_VALUE,
|
||||
maxEventsPerQuery);
|
||||
// The filter pattern syntax metric and subscription filters use: terms, quoted phrases,
|
||||
|
||||
Reference in new issue
Block a user