From 5e4eba54cc46dd9b6c589ed337db7c7af55a3917 Mon Sep 17 00:00:00 2001 From: Venkatadri Duggina Date: Wed, 11 Sep 2019 15:53:20 +0100 Subject: [PATCH 1/2] fixing check3x bug 381 related to cloudwatch groups --- include/check3x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/check3x b/include/check3x index 3b630330..fe006064 100644 --- a/include/check3x +++ b/include/check3x @@ -14,7 +14,7 @@ check3x(){ local CHECK_WARN CLOUDWATCH_GROUP=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region "$REGION" --query 'trailList[*].CloudWatchLogsLogGroupArn' --output text| tr ' ' ' -' | awk -F: '{ print $7 }') +' | awk -F: '{ for (i=7; i<=NF; i=i+7) print $i }') if [[ $CLOUDWATCH_GROUP ]];then for group in $CLOUDWATCH_GROUP; do CLOUDWATCH_LOGGROUP_REGION=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region "$REGION" --query 'trailList[*].CloudWatchLogsLogGroupArn' --output text | tr ' ' ' From dffb09b00171c76c34ad76c3f327ac7d6328a2d2 Mon Sep 17 00:00:00 2001 From: Venki Date: Thu, 12 Sep 2019 12:24:49 +0100 Subject: [PATCH 2/2] updating tr --- include/check3x | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/check3x b/include/check3x index fe006064..3f7b8709 100644 --- a/include/check3x +++ b/include/check3x @@ -13,8 +13,7 @@ check3x(){ local CHECK_OK local CHECK_WARN - CLOUDWATCH_GROUP=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region "$REGION" --query 'trailList[*].CloudWatchLogsLogGroupArn' --output text| tr ' ' ' -' | awk -F: '{ for (i=7; i<=NF; i=i+7) print $i }') + CLOUDWATCH_GROUP=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region "$REGION" --query 'trailList[*].CloudWatchLogsLogGroupArn' --output text| tr '\011' '\012' | awk -F: '{print $7}') if [[ $CLOUDWATCH_GROUP ]];then for group in $CLOUDWATCH_GROUP; do CLOUDWATCH_LOGGROUP_REGION=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region "$REGION" --query 'trailList[*].CloudWatchLogsLogGroupArn' --output text | tr ' ' '