AWS

Download 48
Last updated Jun 6, 2022

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

FieldTypeNameDescription
aws_profileStringConnect profileThe identifier of AWS connect profile
regionStringRegione.g. ap-northeast-2
namespaceStringNamespacee.g. AWS/EC2, AWS/RDS
metricStringMetrice.g. CPUUtilization, NetworkPacketsOut
labelStringLabelDimension and metric
_timeDateTimeBegin of time span
valueDoubleValueAggregated value
dimensionsListDimensionsElements with name and value properties