Reputation: 6196
Is there a easy way to run aws ec2 describe-instance-status
and only display the information of instances if they have any Scheduled Events?
Upvotes: 0
Views: 1470
Reputation: 547
Or you can use --filter
CLI argument for this:
$ aws ec2 describe-instance-status --filters "Name=event.code,Values='instance-reboot','system-reboot','system-maintenance','instance-retirement','instance-stop'"
This filters statuses only down to the ones with events with the specified code. Since this command lists out all possible codes, you basically get only the statuses with one or more events.
Upvotes: 0
Reputation: 5608
You can use the --query
arg for this:
$ aws ec2 describe-instance-status --query 'InstanceStatuses[?length(Events || `[]`) > `0`]'
Upvotes: 1