Amazon AWS CloudWatch
Amazon AWS CloudWatch provides monitoring, logging, and observability for AWS resources and applications, enabling real-time insights and automated responses.
Amazon CloudWatch is a monitoring and observability service from AWS that collects and visualizes logs, metrics, and events from AWS resources and applications. This connector enables Swimlane Turbine users to automate the retrieval, querying, and analysis of CloudWatch Logs, including cross-account and multi-region access. With this integration, security teams can streamline log management, accelerate incident investigations, and orchestrate advanced threat detection and response workflows without writing code. The connector empowers users to efficiently search, filter, and correlate AWS log data directly within Turbine playbooks, enhancing visibility and operational efficiency across cloud environments.
This connector allows Turbine to connect with AWS CloudWatch.
Prerequisites
Before using the Amazon AWS CloudWatch connector, ensure you have the following prerequisites:
- AWS credential authentication using these parameters:
- Access Key ID: The unique identifier for your AWS account credentials, required for API access.
- Secret Key: The secret access key paired with your Access Key ID, used to securely authenticate requests.
Requirements
- AWS Access Key ID: A long-term AWS access key ID with access to IAM.
- AWS Secret Key ID: A long-term secret access key associated with the above AccessKey ID.
Capabilities
This Connector provides the following capabilities:
- Get Log Events
- Get Query Results
- List Log Groups
- List Log Streams
- List Queries
- Start Query
- Stop Query
- Check Log Group Exists
- Run CloudWatch Logs Query
Notes
For more information on AWS Identity and Access Management(IAM):
Configurations
AWS CloudWatch Asset
Authenticates using AWS credentials.
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
access_key | A specific long-term AWS access key ID. | string | Required |
secret_key | A specific long-term AWS secret access key. | string | Required |
region_name | The AWS Region where you want to create new connections. | string | Optional |
role_arn | Role ARN | string | Optional |
session_token | Use if a session token is provided when switching roles. | string | Optional |
external_id | External ID to assume IAM Role. Optional value used for assuming roles. Can be added, or removed in Trusted Relationships of target role. | string | Optional |
role_session_name | Defaults to SessionFromSwimlane_<HASH> when no value is provided. | string | Optional |
Actions
Check Log Group Exists
Check which CloudWatch Logs log groups exist in the specified AWS account and region by passing candidate group names and returning only those that are present.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
session_name | string | Required | Session name to use for the AWS session. This is used to store the session credentials in the asset's secrets manager. |
arn | string | Required | IAM role in the management account to assume first using asset access keys. Spoke accounts must trust this role for cross-account access to their soc role. Not an IAM user ARN (user identity is the asset credentials). |
cloud_account_id | string | Required | AWS account ID of the spoke account to check. |
region | string | Required | AWS region of the spoke account to check. |
log_groups | array | Required | Log group names to check for existence. |
Input Example
{"session_name":"fusion-center-dev","arn":"arn:aws:iam::265337873895:role/soc","cloud_account_id":"016757552019","region":"us-east-1","log_groups":["/aws/eks/turbine-cloud/cluster","/aws/lambda/example","/aws/rds/instance/example/error"]}
Output
Parameter | Type | Description |
|---|---|---|
existing | array | Log groups that exist in the account and region. |
missing | array | Log groups that do not exist in the account and region. |
Output Example
{"existing":["/aws/eks/turbine-cloud/cluster"],"missing":["/aws/lambda/example","/aws/rds/instance/example/error"]}
Get Log Events
Fetch log events from a specified log group in Amazon AWS CloudWatch using the provided log stream name.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
logGroupName | string | Optional | The name of the log group. provide either logGroupName or logGroupIdentifier not both. |
logGroupIdentifier | string | Optional | Specify either the name or ARN of the log group to view events from. provide either logGroupName or logGroupIdentifier not both. |
logStreamName | string | Required | The name of the log stream. |
startTime | string | Optional | The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. |
endTime | string | Optional | The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. |
nextToken | string | Optional | The token for the next set of items to return. |
limit | string | Optional | The maximum number of log events returned. |
startFromHead | boolean | Optional | If the value is true, the earliest log events are returned first. |
unmask | boolean | Optional | Specify true to display the log event fields with all sensitive data unmasked and visible. |
Input Example
{"logGroupName":"/aws/lambda/apphub-bundles","logGroupIdentifier":"xyzabc","logStreamName":"2018/12/04/[$LATEST]d53f6d4b5fe14daa80dcdaab92c5c2a5","startTime":"1562078646","endTime":"1562078646","nextToken":"123ab34c","limit":"100","startFromHead":true,"unmask":true}
Output
Parameter | Type | Description |
|---|---|---|
events | array | Output field: events |
events.timestamp | number | Output field: events.timestamp |
events.message | string | Response message |
events.ingestionTime | number | Time value |
nextForwardToken | string | Output field: nextForwardToken |
nextBackwardToken | string | Output field: nextBackwardToken |
Output Example
{"events":[{"timestamp":123,"message":"string","ingestionTime":123}],"nextForwardToken":"string","nextBackwardToken":"string"}
Get Query Results
Return the results of a specified query from Amazon AWS CloudWatch using the provided queryId.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
queryId | string | Required | The ID number of the query. |
Input Example
{"queryId":"123ABCD"}
Output
Parameter | Type | Description |
|---|---|---|
results | array | Result of the operation |
results.0 | object | Result of the operation |
results.0.field | string | Result of the operation |
results.0.value | string | Value for the parameter |
statistics | object | Output field: statistics |
statistics.recordsMatched | number | Output field: statistics.recordsMatched |
statistics.recordsScanned | number | Output field: statistics.recordsScanned |
statistics.bytesScanned | number | Output field: statistics.bytesScanned |
status | string | Status value |
Output Example
{"results":[[{}]],"statistics":{"recordsMatched":123,"recordsScanned":123,"bytesScanned":123},"status":"Scheduled"}
List Log Groups
Retrieve a list of log groups in Amazon AWS CloudWatch, with optional filtering by prefix and results sorted by log group name.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
accountIdentifiers | array | Optional | Unique identifier |
logGroupNamePrefix | string | Optional | Name of the resource |
logGroupNamePattern | string | Optional | Name of the resource |
nextToken | string | Optional | Parameter for List Log Groups |
limit | number | Optional | Parameter for List Log Groups |
includeLinkedAccounts | boolean | Optional | Parameter for List Log Groups |
Input Example
{"accountIdentifiers":["string"],"logGroupNamePrefix":"string","logGroupNamePattern":"string","nextToken":"string","limit":123,"includeLinkedAccounts":true}
Output
Parameter | Type | Description |
|---|---|---|
logGroups | array | Output field: logGroups |
logGroups.logGroupName | string | Name of the resource |
logGroups.creationTime | number | Time value |
logGroups.retentionInDays | number | Output field: logGroups.retentionInDays |
logGroups.metricFilterCount | number | Count value |
logGroups.arn | string | Output field: logGroups.arn |
logGroups.storedBytes | number | Output field: logGroups.storedBytes |
logGroups.kmsKeyId | string | Unique identifier |
logGroups.dataProtectionStatus | string | Response data |
nextToken | string | Output field: nextToken |
Output Example
{"logGroups":[{"logGroupName":"string","creationTime":123,"retentionInDays":123,"metricFilterCount":123,"arn":"string","storedBytes":123,"kmsKeyId":"string","dataProtectionStatus":"ACTIVATED"}],"nextToken":"string"}
List Log Streams
Retrieve all log streams for a specified log group in Amazon AWS CloudWatch, with optional filtering by prefix.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
logGroupName | string | Optional | The name of the log group. |
logGroupIdentifier | string | Optional | Specify either the name or ARN of the log group to view. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN. |
logStreamNamePrefix | string | Optional | The prefix to match. |
orderBy | string | Optional | the results are ordered by given input, example LogStreamName, LastEventTime, LogStreamName. |
descending | boolean | Optional | If the value is true, results are returned in descending order. |
nextToken | string | Optional | The token for the next set of items to return. |
limit | number | Optional | The maximum number of items returned. If you donβt specify a value, the default is up to 50 items. |
Input Example
{"logGroupName":"/aws/lambda/apphub-bundles","logGroupIdentifier":"xyz","logStreamNamePrefix":"2018/12/04","orderBy":"LogStreamName","descending":true,"nextToken":"axwab","limit":123}
Output
Parameter | Type | Description |
|---|---|---|
logStreams | array | Output field: logStreams |
logStreams.logStreamName | string | Name of the resource |
logStreams.creationTime | number | Time value |
logStreams.firstEventTimestamp | number | Output field: logStreams.firstEventTimestamp |
logStreams.lastEventTimestamp | number | Output field: logStreams.lastEventTimestamp |
logStreams.lastIngestionTime | number | Time value |
logStreams.uploadSequenceToken | string | Output field: logStreams.uploadSequenceToken |
logStreams.arn | string | Output field: logStreams.arn |
logStreams.storedBytes | number | Output field: logStreams.storedBytes |
nextToken | string | Output field: nextToken |
Output Example
{"logStreams":[{"logStreamName":"string","creationTime":123,"firstEventTimestamp":123,"lastEventTimestamp":123,"lastIngestionTime":123,"uploadSequenceToken":"string","arn":"string","storedBytes":123}],"nextToken":"string"}
List Queries
Retrieve a list of CloudWatch Logs Insights queries that are scheduled, running, or recently executed in your AWS account.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
logGroupName | string | Optional | Name of the resource |
status | string | Optional | Status value |
maxResults | number | Optional | Result of the operation |
nextToken | string | Optional | Parameter for List Queries |
Input Example
{"logGroupName":"abcd","status":"Scheduled","maxResults":123,"nextToken":"xyz"}
Output
Parameter | Type | Description |
|---|---|---|
queries | array | Output field: queries |
queries.queryId | string | Unique identifier |
queries.queryString | string | Output field: queries.queryString |
queries.status | string | Status value |
queries.createTime | number | Time value |
queries.logGroupName | string | Name of the resource |
nextToken | string | Output field: nextToken |
Output Example
{"queries":[{"queryId":"string","queryString":"string","status":"Scheduled","createTime":123,"logGroupName":"string"}],"nextToken":"string"}
Run CloudWatch Logs Query
Run a custom query against Amazon AWS CloudWatch Logs within a specified log group and time range, returning matching log events based on your defined parameters.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description | |
|---|---|---|---|---|
session_name | string | Required | Session name to use for the AWS session. This is used to store the session credentials in the asset's secrets manager. | |
arn | string | Required | IAM role in the management account to assume first using asset access keys. Spoke accounts must trust this role for cross-account access to their soc role. Not an IAM user ARN (user identity is the asset credentials). | |
cloud_account_id | string | Required | AWS account ID of the spoke account whose CloudWatch Logs to query. | |
region | string | Required | AWS region of the spoke account whose CloudWatch Logs to query. | |
log_group | string | Required | CloudWatch Logs log group to query. | |
start_iso | string | Required | Start time of the query in ISO 8601 format. | |
end_iso | string | Required | End time of the query in ISO 8601 format. | |
query | string | Required | CloudWatch Logs query to execute. | |
parse_message | boolean | Optional | When true, parse JSON from the @message field and return its fields instead of the raw message. Nested objects are flattened with dot notation (e.g. user.username). | |
limit | number | Required | Maximum number of log events to return. Passed to the CloudWatch Logs API and enforced again on the response. Use this instead of relying on ` | limit` in the query string. |
Input Example
{"session_name":"fusion-center-dev","arn":"arn:aws:iam::265337873895:role/soc","cloud_account_id":"016757552019","region":"us-east-1","log_group":"/aws/eks/turbine-cloud/cluster","start_iso":"2026-06-15T18:20:52Z","end_iso":"2026-06-15T18:23:52Z","query":"fields @timestamp, @message\n| sort @timestamp desc\n| limit 1","parse_message":true,"limit":1}
Output
Parameter | Type | Description |
|---|---|---|
results | array | Result of the operation |
Output Example
{"results":[]}
Start Query
Initiate a scheduled query on a specified log group in Amazon AWS CloudWatch Logs Insights using defined time range and query string.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
logGroupName | string | Optional | The log group on which to perform the query. |
logGroupNames | array | Optional | The list of log groups to be queried. You can include up to 50 log groups. |
logGroupIdentifiers | array | Optional | The list of log groups to query. You can include up to 50 log groups. |
startTime | number | Required | The beginning of the time range to query. |
endTime | number | Required | The end of the time range to query. |
queryString | string | Required | The query string to use. |
limit | number | Optional | The maximum number of log events to return in the query. |
Input Example
{"logGroupName":"/aws/lambda/apphub-bundles","logGroupNames":["string1"],"logGroupIdentifiers":["string1"],"startTime":123,"endTime":123,"queryString":"string","limit":123}
Output
Parameter | Type | Description |
|---|---|---|
queryId | string | Unique identifier |
Output Example
{"queryId":"string"}
Stop Query
Stop a running CloudWatch Logs Insights query using the specified query ID, or receive an error if the query has already completed.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
query_id | string | Required | The ID number of the query to stop. To find this ID number, use DescribeQueries. |
Input Example
{"query_id":"82be43d4-c53f-4b02-9812-37bf08c5c15f"}
Output
Parameter | Type | Description |
|---|---|---|
success | boolean | Whether the operation was successful |
Output Example
{"success":true}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |