Query and monitor AWS CloudWatch logs, metrics, and alarms
Integrate AWS CloudWatch into workflows. Run Log Insights queries, list log groups, retrieve log events, list and get metrics, and monitor alarms. Requires AWS access key and secret access key.
Run a CloudWatch Log Insights query against one or more log groups
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
logGroupNames | array | はい | Log group names to query |
queryString | string | はい | CloudWatch Log Insights query string |
startTime | number | はい | Start time as Unix epoch seconds |
endTime | number | はい | End time as Unix epoch seconds |
limit | number | いいえ | Maximum number of results to return |
| パラメータ | 型 | 説明 |
|---|
results | array | Query result rows (each row is a key/value map of field name to value) |
statistics | object | Query statistics |
↳ bytesScanned | number | Total bytes of log data scanned |
↳ recordsMatched | number | Number of log records that matched the query |
↳ recordsScanned | number | Total log records scanned |
status | string | Query completion status (Complete, Failed, Cancelled, or Timeout) |
List available CloudWatch log groups
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
prefix | string | いいえ | Filter log groups by name prefix |
limit | number | いいえ | Maximum number of log groups to return |
| パラメータ | 型 | 説明 |
|---|
logGroups | array | List of CloudWatch log groups with metadata |
↳ logGroupName | string | Log group name |
↳ arn | string | Log group ARN |
↳ storedBytes | number | Total stored bytes |
↳ retentionInDays | number | Retention period in days (if set) |
↳ creationTime | number | Creation time in epoch milliseconds |
Retrieve log events from a specific CloudWatch log stream
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
logGroupName | string | はい | CloudWatch log group name |
logStreamName | string | はい | CloudWatch log stream name |
startTime | number | いいえ | Start time as Unix epoch seconds |
endTime | number | いいえ | End time as Unix epoch seconds |
limit | number | いいえ | Maximum number of events to return |
| パラメータ | 型 | 説明 |
|---|
events | array | Log events with timestamp, message, and ingestion time |
↳ timestamp | number | Event timestamp in epoch milliseconds |
↳ message | string | Log event message |
↳ ingestionTime | number | Ingestion time in epoch milliseconds |
List log streams within a CloudWatch log group
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
logGroupName | string | はい | CloudWatch log group name |
prefix | string | いいえ | Filter log streams by name prefix |
limit | number | いいえ | Maximum number of log streams to return |
| パラメータ | 型 | 説明 |
|---|
logStreams | array | List of log streams with metadata, sorted by last event time (most recent first) unless a prefix filter is applied |
↳ logStreamName | string | Log stream name |
↳ lastEventTimestamp | number | Timestamp of the last log event in epoch milliseconds |
↳ firstEventTimestamp | number | Timestamp of the first log event in epoch milliseconds |
↳ creationTime | number | Stream creation time in epoch milliseconds |
↳ storedBytes | number | Total stored bytes |
List available CloudWatch metrics
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
namespace | string | いいえ | Filter by namespace (e.g., AWS/EC2, AWS/Lambda) |
metricName | string | いいえ | Filter by metric name |
recentlyActive | boolean | いいえ | Only show metrics active in the last 3 hours |
limit | number | いいえ | Maximum number of metrics to return |
| パラメータ | 型 | 説明 |
|---|
metrics | array | List of metrics with namespace, name, and dimensions |
↳ namespace | string | Metric namespace (e.g., AWS/EC2) |
↳ metricName | string | Metric name (e.g., CPUUtilization) |
↳ dimensions | array | Array of name/value dimension pairs |
Get statistics for a CloudWatch metric over a time range
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
namespace | string | はい | Metric namespace (e.g., AWS/EC2, AWS/Lambda) |
metricName | string | はい | Metric name (e.g., CPUUtilization, Invocations) |
startTime | number | はい | Start time as Unix epoch seconds |
endTime | number | はい | End time as Unix epoch seconds |
period | number | はい | Granularity in seconds (e.g., 60, 300, 3600) |
statistics | array | はい | Statistics to retrieve (Average, Sum, Minimum, Maximum, SampleCount) |
dimensions | string | いいえ | Dimensions as JSON (e.g., {"InstanceId": "i-1234"}) |
| パラメータ | 型 | 説明 |
|---|
label | string | Metric label returned by CloudWatch |
datapoints | array | Datapoints sorted by timestamp with statistics values |
↳ timestamp | number | Datapoint timestamp in epoch milliseconds |
↳ average | number | Average statistic value |
↳ sum | number | Sum statistic value |
↳ minimum | number | Minimum statistic value |
↳ maximum | number | Maximum statistic value |
↳ sampleCount | number | Sample count statistic value |
↳ unit | string | Unit of the metric |
Publish a custom metric data point to CloudWatch
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
namespace | string | はい | Metric namespace (e.g., Custom/MyApp) |
metricName | string | はい | Name of the metric |
value | number | はい | Metric value to publish |
unit | string | いいえ | Unit of the metric (e.g., Count, Seconds, Bytes) |
dimensions | string | いいえ | JSON string of dimension name/value pairs |
| パラメータ | 型 | 説明 |
|---|
success | boolean | Whether the metric was published successfully |
namespace | string | Metric namespace |
metricName | string | Metric name |
value | number | Published metric value |
unit | string | Metric unit |
timestamp | string | Timestamp when the metric was published |
List and filter CloudWatch alarms
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
alarmNamePrefix | string | いいえ | Filter alarms by name prefix |
stateValue | string | いいえ | Filter by alarm state (OK, ALARM, INSUFFICIENT_DATA) |
alarmType | string | いいえ | Filter by alarm type (MetricAlarm, CompositeAlarm) |
limit | number | いいえ | Maximum number of alarms to return |
| パラメータ | 型 | 説明 |
|---|
alarms | array | List of CloudWatch alarms with state and configuration |
↳ alarmName | string | Alarm name |
↳ alarmArn | string | Alarm ARN |
↳ stateValue | string | Current state (OK, ALARM, INSUFFICIENT_DATA) |
↳ stateReason | string | Human-readable reason for the state |
↳ metricName | string | Metric name (MetricAlarm only) |
↳ namespace | string | Metric namespace (MetricAlarm only) |
↳ threshold | number | Threshold value (MetricAlarm only) |
↳ stateUpdatedTimestamp | number | Epoch ms when state last changed |
Create a CloudWatch alarm mute rule that suppresses alarms for a fixed duration
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
muteRuleName | string | はい | Unique name for the mute rule (used later to unmute) |
alarmNames | array | はい | Names of the CloudWatch alarms this mute rule targets |
durationValue | number | はい | How long the mute lasts (paired with durationUnit) |
durationUnit | string | はい | Unit for durationValue: minutes, hours, or days |
description | string | いいえ | Optional description of why the alarms are being muted |
startDate | number | いいえ | When the mute window begins as Unix epoch seconds. Defaults to now (mute starts immediately). |
| パラメータ | 型 | 説明 |
|---|
success | boolean | Whether the mute rule was created successfully |
muteRuleName | string | Name of the mute rule that was created |
alarmNames | array | Names of the alarms this rule mutes |
expression | string | Schedule expression used by the mute rule |
duration | string | ISO 8601 duration of the mute window |
Delete a CloudWatch alarm mute rule, restoring alarm notifications
| パラメータ | 型 | 必須 | 説明 |
|---|
awsRegion | string | はい | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | はい | AWS access key ID |
awsSecretAccessKey | string | はい | AWS secret access key |
muteRuleName | string | はい | Name of the mute rule to delete |
| パラメータ | 型 | 説明 |
|---|
success | boolean | Whether the mute rule was deleted successfully |
muteRuleName | string | Name of the mute rule that was deleted |