Skip to main content

AWS CloudWatch

Overview

The AWS CloudWatch integration ingests CloudWatch logs from AWS via the AWS SDK for CloudWatch Logs.

Supported platforms

  • Linux: Logs
  • Windows: Logs
  • macOS: Logs

Authentication Configuration

AWS CloudWatch supports AWS access-key, assume-role, and IMDS credentials.

ParameterTypeDescription
credential_typeoptionaws for access keys or assume role; awsimds for EC2 metadata credentials.
auth_methodoptionUse access_keys or iam_role for aws credentials.
access_key_idstringAWS access key. Required for access_keys; optional source creds for role.
secret_access_keystringAWS secret key. Required for access_keys; optional source creds for role.
session_tokenstringOptional session token for temporary credentials.
role_arnstringIAM role ARN to assume when auth_method is iam_role.
role_session_namestringOptional session name for the assumed role.
profilestringOptional AWS shared config profile.
imds_endpointstringOptional IMDS endpoint for awsimds credentials.

Note: The Credential Type field is required if not using default AWS credentials.

Basic Configuration

ParameterTypeDefault ValueRequiredDescription
regionstringnoneYesThe AWS region where your CloudWatch logs are located.
start_fromstringnoneNoTimestamp in RFC3339 format indicating where to start reading logs.
poll_intervalstring1mNoTime to wait between log requests (minimum 1s).
max_events_per_requestinteger1000NoMaximum number of events to process per request to CloudWatch.
persist_offsetsbooleantrueNoPersist CloudWatch log reading offsets to resume from where left off.

Advanced Configuration

Log Groups Configuration

ParameterTypeDefault ValueRequiredDescription
log_group_discovery_typestringautodiscoverNoChoose how to discover log groups: Auto Discovery or Named Groups.

Auto Discovery Settings

ParameterTypeDefault ValueRequiredDescription
limitinteger50ConditionalMaximum number of log groups to discover.
prefixstringnoneConditionalPrefix for log group names to filter discovery.
patternstringnoneConditionalCase-sensitive substring that must be present in log group names.
account_identifiersarray[]ConditionalAWS account IDs to filter log groups by.
include_linked_accountsbooleanfalseConditionalWhen using a monitoring account, include log groups from linked source accounts.
Stream Filters
ParameterTypeDefault ValueRequiredDescription
namesarray[]NoFull log stream names to filter (exact matches).
prefixesarray[]NoPrefixes to filter log streams (e.g., ["kube-apiserver"]).

Note: Stream filters apply to discovered log groups. Use names for exact stream matches or prefixes for partial matches. Only one of prefix or pattern can be specified for log group discovery. If both are omitted, all log streams up to the limit are collected.

Named Log Groups

Array of log group configs with:

ParameterTypeDefault ValueRequiredDescription
log_group_namestringnoneYesFull log group name to collect logs from.
namesarray[]NoFull log stream names to filter.
prefixesarray[]NoPrefixes to filter log streams.

Example Configuration

{
"region": "us-west-2", // required

"logs": {
"start_from": "2024-01-01T00:00:00Z",
"poll_interval": "1m", // default: "1m"
"max_events_per_request": 1000, // default: 1000
"persist_offsets": true, // default: true

"groups": {
"log_group_discovery_type": "autodiscover", // default: "autodiscover"

"autodiscover": {
"limit": 50, // default: 50
"prefix": "/aws/eks/",
"pattern": "kube",
"account_identifiers": ["123456789012"],
"include_linked_accounts": false,
"streams": {
"names": [],
"prefixes": ["kube-apiserver"],
},
},
},
},
}