🦊

aws-cliでパラシを作ろう # CloudWatch

2021/10/27に公開

Alarm

aws cloudwatch describe-alarms \
    --output json \
    --query "MetricAlarms[].{AlarmName:AlarmName, StateValue:StateValue, AlarmConfigurationUpdatedTimestamp:AlarmConfigurationUpdatedTimestamp, Namespace:Namespace, MetricName:MetricName, Statistic:Statistic, Period:Period, EvaluationPeriods:EvaluationPeriods, AlarmArn:AlarmArn}" \
    | jq -r ".[] | [.AlarmName, .StateValue, .AlarmConfigurationUpdatedTimestamp, .Namespace, .MetricName, .Statistic, .Period, .EvaluationPeriods, .AlarmArn] | @csv"

Logs

ロググループ
aws logs describe-log-groups \
    --output json \
    --query "logGroups[].{logGroupName:logGroupName, retentionInDays:retentionInDays, metricFilterCount:metricFilterCount, storedBytes:storedBytes, arn:arn, creationTime:creationTime}" \
    | jq -r ".[] | [.logGroupName, .retentionInDays, .metricFilterCount, .storedBytes, .arn, .creationTime] | @csv"

Discussion