Amazon Web Services (AWS) - List Cloudwatch Alarm Log Groups using the AWS CLI

by
Jeremy Canfield |
Updated: October 06 2023
| Amazon Web Services (AWS) articles
This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.
Cloudwatch alarms can be used to alert you when some conditiion is met, such as if an EC2 instance is unavailable due to high CPU or high memory usage.
The aws logs describe-log-groups command can be used to list the Cloudwatch Log Groups you have created.
aws logs describe-log-groups
And here is an example of how to limit the output using the --query option.
aws logs describe-log-groups --query 'logGroups[?logGroupName==`foo_log_group`]'
Something like this should be returned.
{
"logGroups": [
{
"logGroupName": "foo_log_group",
"creationTime": 1596419418715,
"metricFilterCount": 0,
"arn": "arn:aws:logs:us-east-1:123456789012:log-group:foo_log_group:*",
"storedBytes": 897
},
{
"logGroupName": "bar_log_group",
"creationTime": 1596419769060,
"metricFilterCount": 0,
"arn": "arn:aws:logs:us-east-1:123456789012:log-group:bar_log_group:*",
"storedBytes": 956
}
]
}
Did you find this article helpful?
If so, consider buying me a coffee over at