aws-cloudwatch-stats
Retrieves all metric data of your AWS CloudWatch.
aws-cloudwatch-stats span=SPAN [profile=PROFILE] [region=REGION] [duration=NUM{mon|w|d|h|m|s}] [from=yyyyMMddHHmmss] [to=yyyyMMddHHmmss] [stat=STAT] [namespace=NAMESPACE] [metric=METRIC] [dimension=DIMENSION] [value=VALUE]
- span=SPAN
- Time span. You should use s(second), m(minute), h(hour), d(day), mon(month) time unit. For example,
10s
means 10 seconds interval. - profile=PROFILE
- The identifier of AWS connect profile
- region=REGION
- AWS region
- duration=NUM{mon|w|d|h|m|s}
- Scan only recent data. You should use s(second), m(minute), h(hour), d(day), mon(month) time unit. For example,
10s
means data from 10 seconds earlier. - from=yyyyMMddHHmmss
- Start time of range. yyyyMMddHHmmss format. If you omit time part, it will be padded by zero.
- to=yyyyMMddHHmmss
- End time of range. yyyyMMddHHmmss format. If you omit time part, it will be padded by zero.
- stat=STAT
- Aggregation function. one of min, max, sum, avg, count. avg by default.
- namespace=NAMESPACE
- Filter by namespace
- metric=METRIC
- Filter by metric
- dimension=DIMENSION
- Filter by dimension
- value=VALUE
- Filter by value
AWS IAM Policy
To use this command, you must allow the below permissions in your AWS IAM policy:
- cloudwatch:GetMetricData
Output Fields
Field | Type | Name | Description |
---|---|---|---|
aws_profile | String | Connect profile | The identifier of AWS connect profile |
region | String | Region | e.g. ap-northeast-2 |
namespace | String | Namespace | e.g. AWS/EC2, AWS/RDS |
metric | String | Metric | e.g. CPUUtilization, NetworkPacketsOut |
label | String | Label | Dimension and metric |
_time | Date | Time | Begin of time span |
value | Double | Value | Aggregated value |
dimensions | List | Dimensions | Elements with name and value properties |