我在AWS Cloud Watch中有大量的日志组,现在我要做的是获取包含示例字符串的日志组列表,是否有更好的方法通过包含来过滤大量的日志组AWS CloudWatch,我有此示例代码
List<LogGroup> groups = new List<LogGroup>();
try
{
DescribeLogGroupsRequest req = new DescribeLogGroupsRequest()
{
};
DescribeLogGroupsResponse rep = logsClient.DescribeLogGroups(req);
groups.AddRange(rep.LogGroups.Where(x => x.LogGroupName.Contains(samplestring)));
}
catch (AmazonCloudWatchLogsException e)
{
}