This page explains how to subscribe selected CloudWatch log groups to the designated Firehose stream ingesting logs into Dynatrace.
AWS log ingestion (push-based) must be enabled and deployed within the designated AWS account as part of connection setup and management.
For details, see Onboard AWS logs.
To ensure that the Dynatrace log ingest CloudFormation stack was deployed correctly
StackSet-DynatraceLogsIngest- followed by your Dynatrace Environment ID and alphanumerical characters. For example:
StackSet-DynatraceLogsIngest-abc12345-bd714890-987c-11f0-8b1f-0e8082238e73-c43acbc9-7840-4b73-affc-2052f5c73c0f
CloudWatchLogsRoleArn: ARN of the IAM role to use when creating a CloudWatch subscription filter.FirehoseDeliveryStreamArn: ARN of the Firehose delivery stream pushing data to Dynatrace.The log ingest StackSet instance deploys a single Firehose stream in each user enabled region.
When a connection has been created with the Log ingest enabled option turned on, the next step is to subscribe CloudWatch log groups.
You might have your own GitOps processes to subscribe log groups already; if not, see the options below on how to do so.
To fetch the shell script, run the command below in a bash shell.
wget -q https://dynatrace-data-acquisition.s3.us-east-1.amazonaws.com/aws/deployment/cfn/da-log-groups-subscription.sh -O da-log-groups-subscription.sh && chmod +x ./da-log-groups-subscription.sh
You can use CloudShell, which is available in the AWS Console. Otherwise, if you have AWS CLI configured, you can use a bash-compliant shell. The scripts assume that REGION is set on the shell or AWS CLI configuration.
You can specify all the log group names in the script parameter, making sure to replace:
<cloudformation_stack_name> with name collected in prerequisites.
<your_log_group_list> with a space-separated list of the log group names you want to subscribe to.
Example list: /aws/lambda/my-lambda /aws/apigateway/my-api
./da-log-groups-subscription.sh subscribe --stack-name <cloudformation_stack_name> --log-groups <your_log_group_list>
You can list all the group names in a text file and specify the file name as a script parameter.
Create a file and list each log group name on a separate line.
Save the file.
Run the command below, making sure to replace:
<cloudformation_stack_name> with name collected in prerequisites<your_file_name> with the actual file name../da-log-groups-subscription.sh subscribe --stack-name <cloudformation_stack_name> --log-groups-from-file <your_file_name>
To simplify the file creation, you can use the auto-discovery command below to list the names of all log groups in your account. You can adjust the list manually before subscribing. Make sure to replace: <your_log_groups_file> with the file name to which you want to redirect the output.
./da-log-groups-subscription.sh discover-log-groups > <your_log_groups_file>
To list the names of log groups matching specific pattern, use the command below. Make sure to replace:
<your_log_groups_file> with the file name to which you want to redirect the output.<log_group_name_pattern> with the string to match in log group name../da-log-groups-subscription.sh discover-log-groups --log-group-name-pattern <log_group_name_pattern> > <your_log_groups_file>
By default, you subscribe to all the logs in the log group. Use this option if you want to restrict the logs you subscribe to.
See Filter and pattern syntax for more details.
Run the command below, making sure to replace <your_log_group_list> and <your_filter_pattern> with your values.
./da-log-groups-subscription.sh subscribe --log-groups <your_log_group_list> --filter-pattern <your_filter_pattern>
To stop forwarding logs to Dynatrace, use one of the two options below to unsubscribe the CloudWatch log groups.
Run the command below, making sure to replace <your_log_group_list> with a space-separated list of the log group names you want to unsubscribe from. Make sure to replace:
<cloudformation_stack_name> with name collected in prerequisites.<your_log_group_list> with a space-separated list of the log group names you want to subscribe to.
Example list: /aws/lambda/my-lambda /aws/apigateway/my-api./da-log-groups-subscription.sh unsubscribe --stack-name <cloudformation_stack_name> --log-groups <your_log_group_list>
Run the command below, making sure to replace:
<cloudformation_stack_name> with name collected in prerequisites.<your_file_name> with the file name you created to subscribe by reading log groups from file../da-log-groups-subscription.sh unsubscribe --stack-name <cloudformation_stack_name> --log-groups-from-file <your_file_name>
After configuring log subscription streaming, you should be able to view and analyze AWS logs in 
 Logs. Go to Logs & Events or 
 Notebooks, and filter for AWS logs.
Logs ingested via Amazon Data Firehose will be enriched with the stream name attribute key: dt.da.aws.data_firehose.arn; the attribute value will be resolved to the Amazon Resource Name (ARN) of the Firehose stream.
Logs from AWS services with entity linking support will automatically be displayed in 
 Clouds for context analysis.
If you don't see any logs after 10 minutes, see Troubleshooting.
Verify in the AWS Console that logs from CloudWatch are sent into Firehose.
In the AWS Console, go to Amazon Data Firehose and select the Firehose instance. Check Firehose delivery stream metrics (incoming PUT requests, incoming bytes).
If there's no data sent to Firehose, verify that subscribed CloudWatch log groups are producing new logs.
If the subscription filter was created manually, verify that the correct IAM role and Firehose instance were selected when creating the subscription filter.
Verify that logs are successfully sent from Firehose to Dynatrace. Check Firehose Delivery stream metrics (HTTP endpoint delivery success, records delivered to HTTP endpoint). In case of errors, check AWS Firehose CloudWatch Logs for details.
If the Destination error logs tab (in the AWS Firehose console) displays this error message:
Delivery to the endpoint was unsuccessful. See Troubleshooting HTTP Endpoints in the Firehose documentation for more information. Response received with status code. 403: "requestId":"xxxx,"errorMessage":"The authorization token does not provide the necessary permissions. details: missing\_scopes=\[data-acquisition:logs:ingest]
Verify that:
The Platform ingest token is assigned with the correct permission scope (data-acquisition:logs:ingest).
The Dynatrace IAM user who created the platform token is also assigned with same token permission scope (data-acquisition:logs:ingest).
The Platform ingest token has not expired.
For more information on Dynatrace IAM, see Create an AWS connection.
LimitExceededException error occurs.
Notebooks
Clouds