Skip to content

Integrations

CloudWatch

Query and monitor AWS CloudWatch logs, metrics, and alarms

Use AWS CloudWatch to query logs, retrieve log events, inspect log groups and streams, read metrics and alarms, and publish custom metric data. Connect with a saved AWS credential.

Choose Query Logs (Insights) for a query across log groups, or Get Log Events for one stream. Metric statistics use a time range and period; alarm actions report the current state. Pass results to later steps for incident investigation or threshold-based notifications.

Use the block

Run Log Insights queries, list log groups, retrieve log events, list and get metrics, and monitor alarms.

Actions

CloudWatch Query Logs

Run a CloudWatch Log Insights query against one or more log groups

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
logGroupNamesarrayYesLog group names to query
queryStringstringYesCloudWatch Log Insights query string
startTimenumberYesStart time as Unix epoch seconds
endTimenumberYesEnd time as Unix epoch seconds
limitnumberNoMaximum number of results to return

Output

ParameterTypeDescription
resultsarrayQuery result rows (each row is a key/value map of field name to value)
statisticsobjectQuery statistics
↳ bytesScannednumberTotal bytes of log data scanned
↳ recordsMatchednumberNumber of log records that matched the query
↳ recordsScannednumberTotal log records scanned
statusstringQuery completion status (Complete, Failed, Cancelled, or Timeout)
queryIdstringID of the Logs Insights query

CloudWatch Filter Log Events

Search log events across all streams in a log group by filter pattern and time range, without writing a Log Insights query

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
logGroupNamestringYesCloudWatch log group name to search
filterPatternstringNoCloudWatch Logs filter pattern (e.g., "ERROR", "?ERROR ?Exception"). Matches all events if omitted.
logStreamNamePrefixstringNoOnly search log streams whose name starts with this prefix
startTimenumberNoStart time as Unix epoch seconds
endTimenumberNoEnd time as Unix epoch seconds
startFromHeadbooleanNoReturn the earliest matching events first instead of the latest
limitnumberNoMaximum number of events to return
nextTokenstringNoPagination token from a previous call to continue where it stopped

Output

ParameterTypeDescription
eventsarrayMatching log events across all searched streams, sorted by timestamp
↳ logStreamNamestringLog stream the event belongs to
↳ timestampnumberEvent timestamp in epoch milliseconds
↳ messagestringLog event message
↳ ingestionTimenumberIngestion time in epoch milliseconds
↳ eventIdstringUnique ID of the log event
nextTokenstringToken to fetch the next page of matching events, if more remain

CloudWatch Describe Log Groups

List available CloudWatch log groups

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
prefixstringNoFilter log groups by name prefix
limitnumberNoMaximum number of log groups to return

Output

ParameterTypeDescription
logGroupsarrayList of CloudWatch log groups with metadata
↳ logGroupNamestringLog group name
↳ arnstringLog group ARN
↳ storedBytesnumberTotal stored bytes
↳ retentionInDaysnumberRetention period in days (if set)
↳ creationTimenumberCreation time in epoch milliseconds

CloudWatch Get Log Events

Retrieve log events from a specific CloudWatch log stream

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
logGroupNamestringYesCloudWatch log group name
logStreamNamestringYesCloudWatch log stream name
startTimenumberNoStart time as Unix epoch seconds
endTimenumberNoEnd time as Unix epoch seconds
limitnumberNoMaximum number of events to return
nextTokenstringNoToken from a previous call (nextForwardToken or nextBackwardToken) to page through the stream

Output

ParameterTypeDescription
eventsarrayLog events with timestamp, message, and ingestion time
↳ timestampnumberEvent timestamp in epoch milliseconds
↳ messagestringLog event message
↳ ingestionTimenumberIngestion time in epoch milliseconds
nextForwardTokenstringToken for the next, newer page of events (returns the same token when the end of the stream is reached)
nextBackwardTokenstringToken for the previous, older page of events

CloudWatch Describe Log Streams

List log streams within a CloudWatch log group

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
logGroupNamestringYesCloudWatch log group name
prefixstringNoFilter log streams by name prefix
limitnumberNoMaximum number of log streams to return

Output

ParameterTypeDescription
logStreamsarrayList of log streams with metadata, sorted by last event time (most recent first) unless a prefix filter is applied
↳ logStreamNamestringLog stream name
↳ lastEventTimestampnumberTimestamp of the last log event in epoch milliseconds
↳ firstEventTimestampnumberTimestamp of the first log event in epoch milliseconds
↳ creationTimenumberStream creation time in epoch milliseconds
↳ storedBytesnumberTotal stored bytes

CloudWatch Set Log Group Retention

Set (or clear, for never-expire) the retention period for a CloudWatch log group

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
logGroupNamestringYesCloudWatch log group name
retentionInDaysnumberNoDays to retain log events (one of 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653). Omit to make events never expire.

Output

ParameterTypeDescription
successbooleanWhether the retention policy was updated
logGroupNamestringLog group the policy applies to
retentionInDaysnumberRetention period in days, or null if events never expire

CloudWatch List Metrics

List available CloudWatch metrics

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
namespacestringNoFilter by namespace (e.g., AWS/EC2, AWS/Lambda)
metricNamestringNoFilter by metric name
recentlyActivebooleanNoOnly show metrics active in the last 3 hours
limitnumberNoMaximum number of metrics to return

Output

ParameterTypeDescription
metricsarrayList of metrics with namespace, name, and dimensions
↳ namespacestringMetric namespace (e.g., AWS/EC2)
↳ metricNamestringMetric name (e.g., CPUUtilization)
↳ dimensionsarrayArray of name/value dimension pairs

CloudWatch Get Metric Statistics

Get statistics for a CloudWatch metric over a time range

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
namespacestringYesMetric namespace (e.g., AWS/EC2, AWS/Lambda)
metricNamestringYesMetric name (e.g., CPUUtilization, Invocations)
startTimenumberYesStart time as Unix epoch seconds
endTimenumberYesEnd time as Unix epoch seconds
periodnumberYesGranularity in seconds (e.g., 60, 300, 3600)
statisticsarrayNoStatistics to retrieve (Average, Sum, Minimum, Maximum, SampleCount). Required unless extendedStatistics is set, which takes precedence
dimensionsstringNoDimensions as JSON (e.g., {"InstanceId": "i-1234"})
extendedStatisticsarrayNoPercentile statistics to retrieve (e.g., ["p99", "p95"]). AWS accepts either Statistics or ExtendedStatistics, so when set these are requested instead of statistics
unitstringNoOnly return data reported with this unit (e.g., Percent, Milliseconds). Omit to return all units

Output

ParameterTypeDescription
labelstringMetric label returned by CloudWatch
datapointsarrayDatapoints sorted by timestamp with statistics values
↳ timestampnumberDatapoint timestamp in epoch milliseconds
↳ averagenumberAverage statistic value
↳ sumnumberSum statistic value
↳ minimumnumberMinimum statistic value
↳ maximumnumberMaximum statistic value
↳ sampleCountnumberSample count statistic value
↳ unitstringUnit of the metric
↳ extendedStatisticsjsonPercentile values keyed by statistic (e.g., {"p99": 120.5})

CloudWatch Publish Metric

Publish a custom metric data point to CloudWatch

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
namespacestringYesMetric namespace (e.g., Custom/MyApp)
metricNamestringYesName of the metric
valuenumberYesMetric value to publish
unitstringNoUnit of the metric (e.g., Count, Seconds, Bytes)
dimensionsstringNoJSON string of dimension name/value pairs

Output

ParameterTypeDescription
successbooleanWhether the metric was published successfully
namespacestringMetric namespace
metricNamestringMetric name
valuenumberPublished metric value
unitstringMetric unit
timestampstringTimestamp when the metric was published

CloudWatch Describe Alarms

List and filter CloudWatch alarms

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
alarmNamePrefixstringNoFilter alarms by name prefix
stateValuestringNoFilter by alarm state (OK, ALARM, INSUFFICIENT_DATA)
alarmTypestringNoFilter by alarm type (MetricAlarm, CompositeAlarm)
limitnumberNoMaximum number of alarms to return
nextTokenstringNoPagination token from a previous call

Output

ParameterTypeDescription
alarmsarrayList of CloudWatch alarms with state and configuration
↳ alarmNamestringAlarm name
↳ alarmArnstringAlarm ARN
↳ stateValuestringCurrent state (OK, ALARM, INSUFFICIENT_DATA)
↳ stateReasonstringHuman-readable reason for the state
↳ metricNamestringMetric name (MetricAlarm only)
↳ namespacestringMetric namespace (MetricAlarm only)
↳ thresholdnumberThreshold value (MetricAlarm only)
↳ comparisonOperatorstringComparison operator (MetricAlarm only)
↳ evaluationPeriodsnumberNumber of periods evaluated (MetricAlarm only)
↳ stateUpdatedTimestampnumberEpoch ms when state last changed
↳ alarmTypestringMetricAlarm or CompositeAlarm
↳ alarmDescriptionstringAlarm description
↳ actionsEnabledbooleanWhether actions run on state changes
↳ alarmActionsarrayARNs of actions run on ALARM
↳ okActionsarrayARNs of actions run on OK
↳ insufficientDataActionsarrayARNs of actions run on INSUFFICIENT_DATA
↳ stateReasonDatastringMachine-readable JSON explaining the state
↳ stateTransitionedTimestampnumberEpoch ms when the state value last changed
↳ alarmConfigurationUpdatedTimestampnumberEpoch ms when the alarm configuration last changed
↳ statisticstringStatistic evaluated (MetricAlarm only)
↳ extendedStatisticstringPercentile statistic evaluated (MetricAlarm only)
↳ dimensionsarrayMetric dimensions as {name, value} (MetricAlarm only)
↳ periodnumberEvaluation period in seconds (MetricAlarm only)
↳ unitstringMetric unit (MetricAlarm only)
↳ datapointsToAlarmnumberBreaching datapoints needed to alarm (MetricAlarm only)
↳ treatMissingDatastringHow missing data is treated (MetricAlarm only)
↳ thresholdMetricIdstringID of the metric-math threshold query (anomaly detection alarms)
↳ metricsarrayMetric-math queries [{id, expression, label, returnData, period, accountId, metricStat}] (MetricAlarm only)
↳ alarmRulestringRule expression (CompositeAlarm only)
nextTokenstringPagination token for the next page of alarms

CloudWatch Describe Alarm History

Retrieve state-change and configuration history for CloudWatch alarms

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
alarmNamestringNoName of a specific alarm to retrieve history for. Omit for all alarms.
historyItemTypestringNoFilter by history item type (ConfigurationUpdate, StateUpdate, Action, AlarmContributorStateUpdate, AlarmContributorAction)
startDatenumberNoStart of the history window as Unix epoch seconds
endDatenumberNoEnd of the history window as Unix epoch seconds
scanBystringNoSort order: TimestampDescending (newest first) or TimestampAscending
limitnumberNoMaximum number of history records to return

Output

ParameterTypeDescription
alarmHistoryItemsarrayAlarm history items sorted per scanBy, newest first by default
↳ alarmNamestringName of the alarm this history item belongs to
↳ alarmTypestringMetricAlarm or CompositeAlarm
↳ timestampnumberEpoch ms when the history item occurred
↳ historyItemTypestringConfigurationUpdate, StateUpdate, Action, or contributor variants
↳ historySummarystringHuman-readable summary of the event
↳ historyDatastringJSON string with event details (e.g., old and new state with reason data for StateUpdate)
↳ alarmContributorIdstringID of the alarm contributor, for contributor history items

CloudWatch Mute Alarm

Create a CloudWatch alarm mute rule that suppresses alarms for a fixed duration

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
muteRuleNamestringYesUnique name for the mute rule (used later to unmute)
alarmNamesarrayYesNames of the CloudWatch alarms this mute rule targets
durationValuenumberYesHow long the mute lasts (paired with durationUnit)
durationUnitstringYesUnit for durationValue: minutes, hours, or days
descriptionstringNoOptional description of why the alarms are being muted
startDatenumberNoWhen the mute window begins as Unix epoch seconds. Defaults to now (mute starts immediately).

Output

ParameterTypeDescription
successbooleanWhether the mute rule was created successfully
muteRuleNamestringName of the mute rule that was created
alarmNamesarrayNames of the alarms this rule mutes
expressionstringSchedule expression used by the mute rule
durationstringISO 8601 duration of the mute window

CloudWatch Unmute Alarm

Delete a CloudWatch alarm mute rule, restoring alarm notifications

Inputs and outputs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
muteRuleNamestringYesName of the mute rule to delete

Output

ParameterTypeDescription
successbooleanWhether the mute rule was deleted successfully
muteRuleNamestringName of the mute rule that was deleted
Was this helpful?
Suggest an edit