jq -r '.logGroups | map(select(.retentionInDays == null or .retentionInDays == "")) | sort_by(.storedBytes) | .[] | [.logGroupName, .logGroupClass, .retentionInDays, .storedBytes] | @csv' 明日みんなに使ってほしいサンプル "/aws/codebuild/xxxxx", "STANDARD", , 86 "/aws/lambda/yyyyy", "STANDARD", , 106 "/aws/OpenSearchService/domains/zzzzz/search-logs", "STANDARD", , 239 ︙ "/aws/lambda/aaaaa", "STANDARD", , 510708032 "/aws/lambda/bbbbb", "STANDARD", , 521204122 "/aws/lambda/ccccc", "STANDARD", , 532498400