Shadi
Shadi

Reputation: 10335

AWS CLI: cloudwatch describe-alarms filter by namespace

From the AWS CLI docs,

aws cloudwatch describe-alarms does not have a --namespace argument to filter results.

On the other hand,

aws cloudwatch get-metric-statistics does have it.

Is it at all possible to filter the alarms by namespace with the AWS CLI?

Upvotes: 1

Views: 1897

Answers (1)

Ankit Gupta
Ankit Gupta

Reputation: 760

You can use --query option in aws cli. The --query parameter accepts strings that are compliant with the JMESPath specification. It is pretty powerful tool to express filtering options.

For your use case

aws cloudwatch describe-alarms  --query 'MetricAlarms[?Namespace==`AWS/DynamoDB`]'

Upvotes: 1

Related Questions