deprecated
The Dynatrace AWS log forwarder is now deprecated in favor of the new Stream logs via Amazon Data Firehose, which allows ingesting cloud logs directly without any additional infrastructure and with increased throughput. To check the available alternative integrations, see Set up Dynatrace on Amazon Web Services.
End of support for the Dynatrace AWS log forwarder is planned for Dec 31, 2024.
DDU pricing applies to cloud Log Monitoring. See DDUs for Log Monitoring for details.
AWS log forwarding allows you to stream logs from Amazon CloudWatch into Dynatrace logs via an ActiveGate.
To enable AWS log forwarding, you need to deploy our special-purpose CloudFormation stack into your AWS account. The stack consists of a Kinesis Firehose instance and a Lambda function. These resources incur AWS costs according to standard AWS billing policy. The same applies to included self-monitoring resources (CloudWatch dashboards and metrics).
Supported services
AWS CloudTrail log group name is chosen by user. For log enrichment, start the log group name with aws-cloudtrail-logs
.
AWS log forwarder supports maximum 1 GB of data processing per hour in the default configuration.
Delivery - log entries
and Delivery - data volume
.Kinesis - record age
.For scaling recommendations, see the scaling guide below.
If you're using an earlier version of Dynatrace, see Alternative deployments for instructions.
The deployment script uses the default AWS CLI profile configuration. The profile will determine the AWS account and region. To change the account or region:
You need the following permissions to run the deployment script:
{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Action": ["cloudformation:CreateChangeSet","cloudformation:ExecuteChangeSet","cloudformation:DescribeChangeSet","cloudformation:DescribeStackEvents","cloudformation:DescribeStacks","cloudformation:GetTemplateSummary","ec2:DescribeImages","s3:CreateBucket","s3:PutLifecycleConfiguration","s3:PutBucketPublicAccessBlock","iam:GetRole","iam:CreateRole","iam:AttachRolePolicy","iam:PutRolePolicy","iam:GetRolePolicy","iam:PassRole","lambda:CreateFunction","lambda:UpdateFunctionCode","lambda:GetFunction","lambda:GetFunctionCodeSigningConfig","cloudwatch:PutDashboard","cloudwatch:GetDashboard","firehose:DescribeDeliveryStream","firehose:CreateDeliveryStream","firehose:ListTagsForDeliveryStream","logs:DeleteSubscriptionFilter","logs:DescribeLogGroups","logs:PutSubscriptionFilter","ssm:GetParameters"],"Resource": "*"}]}
Set the following environment variables, making sure to replace the placeholders (<...>
) with your own values.
TARGET_URL
, enter your environment URL: https://<your_environment_ID>.live.dynatrace.com
. To learn how to determine your environment ID for the SaaS or Managed deployment, see environment ID.TARGET_API_TOKEN
, enter your API token. For instructions, see Prerequisites.STACK_NAME
, the default value is dynatrace-aws-logs
. To provide another name for the CloudFormation stack where you want to deploy the resources, replace the default value with your own.TARGET_URL=<your_environment_URL>TARGET_API_TOKEN=<your_API_token>STACK_NAME=dynatrace-aws-logs
Download the script and deploy the infrastructure.
wget -O dynatrace-aws-log-forwarder.zip https://github.com/dynatrace-oss/dynatrace-aws-log-forwarder/releases/latest/download/dynatrace-aws-log-forwarder.zip \&& unzip -qo dynatrace-aws-log-forwarder.zip \&& ./dynatrace-aws-logs.sh deploy --target-url $TARGET_URL --target-api-token $TARGET_API_TOKEN --stack-name $STACK_NAME --require-valid-certificate true
After deploying the infrastructure, you need to subscribe to the log groups whose logs you want to forward to Dynatrace.
To subscribe to log groups, you have the options described below.
Use parameter [--stack-name <your_stack_name>]
in case you changed the default value during deployment.
Usage recommendation: Use this option if the number of log groups you'd like to subscribe to is small.
To subscribe: 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 subscribe to.
Example list: /aws/lambda/my-lambda /aws/apigateway/my-api
./dynatrace-aws-logs.sh subscribe --log-groups <your_log_group_list>
Usage recommendation: Use this option if the number of log groups you'd like to subscribe to is large.
<your_file_name>
with the actual file name.
./dynatrace-aws-logs.sh subscribe --log-groups-from-file <your_file_name>
To simplify 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.
Be sure to replace <your_log_groups_file>
with the name of the file to which you want to redirect the output.
./dynatrace-aws-logs.sh discover-log-groups > <your_log_groups_file>
Usage recommendation: 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 details on the pattern syntax.
Limitation: You can use only two subscription filters per log group, so the possibility of creating multiple filters with different patterns is limited. If you create a subscription filter that exceeds the limit, an AWS LimitExceededException
occurs.
To subscribe: Run the command below, making sure to replace <your_log_group_list>
and <your_filter_pattern>
with your own values.
./dynatrace-aws-logs.sh subscribe --log-groups <your_log_group_list> --filter-pattern <your_filter_pattern>
For additional subscription options, see the commands below.
Consult the Subscription table for the commands below when replacing placeholders (<...>
) with your own values.
dynatrace-aws-logs.sh subscribe {--log-groups <your_log_group_list> | --log-groups-from-file <your_file_name>}[--stack-name <your_stack_name>] [--filter-pattern <your_filter_pattern>] [--role-arn ROLE_ARN] [--firehose-arn FIREHOSE_ARN]
--log-groups
LOG_GROUPS_LIST
/aws/lambda/my-lambda /aws/apigateway/my-api
.--log-groups-from-file
LOG_GROUPS_FILE
--filter-pattern
FILTER_PATTERN
--stack-name
STACK_NAME
dynatrace-aws-logs
--firehose-arn
FIREHOSE_ARN
$DEFAULT_STACK_NAME
default value or the one specified with the --stack-name <your_stack_name>
option.--role-arn
ROLE_ARN
$DEFAULT_STACK_NAME
default value or the one specified with the --stack-name <your_stack_name>
option.If you don't want to forward logs to Dynatrace anymore, use one of the two options below to unsubscribe from 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.
./dynatrace-aws-logs.sh unsubscribe --log-groups <your_log_group_list>
Run the command below, making sure to replace <your_file_name>
with the file name you created to subscribe by reading log groups from file.
./dynatrace-aws-logs.sh unsubscribe --log-groups-from-file <your_file_name>
For additional unsubscribe options, see the commands below.
Consult the Unsubscribe table for the commands below when replacing the placeholders (<...>
) with your own values.
dynatrace-aws-logs.sh unsubscribe {--log-groups <your_log_group_list> | --log-groups-from-file <your_file_name>} [--stack-name <your_stack_name>]
--log-groups
LOG_GROUPS_LIST
/aws/lambda/my-lambda /aws/apigateway/my-api
.--log-groups-from-file
LOG_GROUPS_FILE
--stack-name
STACK_NAME
dynatrace-aws-logs
To replace your old stack with a new version of the AWS log forwarder stack, deploy the new stack using the same parameters that you used before (especially the stack name, if you changed it from the default value).
If you don't want to use direct ingest through the Cluster API, you need to use an existing ActiveGate version 1.217+. The ActiveGate must be available publicly. The stack will be created without a dedicated ActiveGate if you choose this option.
Although the Log Forwarder will still work without self-monitoring metrics, it is recommended to have them also ingested into CloudWatch. Therefore, internet access to AWS endpoints is required.
See below for instructions.
Dynatrace version 1.217+
{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Action": ["cloudformation:CreateChangeSet","cloudformation:ExecuteChangeSet","cloudformation:DescribeChangeSet","cloudformation:DescribeStackEvents","cloudformation:DescribeStacks","cloudformation:GetTemplateSummary","ec2:DescribeImages","s3:CreateBucket","s3:PutLifecycleConfiguration","s3:PutBucketPublicAccessBlock","iam:GetRole","iam:CreateRole","iam:AttachRolePolicy","iam:PutRolePolicy","iam:GetRolePolicy","iam:PassRole","lambda:CreateFunction","lambda:UpdateFunctionCode","lambda:GetFunction","lambda:GetFunctionCodeSigningConfig","cloudwatch:PutDashboard","cloudwatch:GetDashboard","firehose:DescribeDeliveryStream","firehose:CreateDeliveryStream","firehose:ListTagsForDeliveryStream","logs:DeleteSubscriptionFilter","logs:DescribeLogGroups","logs:PutSubscriptionFilter","ssm:GetParameters"],"Resource": "*"}]}
Set the following environment variables, making sure to replace the placeholders (<...>
) with your own values, as follows.
TARGET_URL
, enter the API URL of your ActiveGate endpoint: https://<your_activegate_IP_or_hostname>:9999/e/<your_environment_ID>
. To learn how to determine your environment ID, see environment ID.TARGET_API_TOKEN
, enter your API token. For instructions, see Prerequisites.If you want Dynatrace to verify the SSL certificate of your Dynatrace environment URL, you can set REQUIRE_VALID_CERTIFICATE
to true
.
TARGET_URL=<your_API_URL>TARGET_API_TOKEN=<your_API_token>REQUIRE_VALID_CERTIFICATE=false
Download the script and deploy the infrastructure.
wget -O dynatrace-aws-log-forwarder.zip https://github.com/dynatrace-oss/dynatrace-aws-log-forwarder/releases/latest/download/dynatrace-aws-log-forwarder.zip \&& unzip -qo dynatrace-aws-log-forwarder.zip \&& ./dynatrace-aws-logs.sh deploy --target-url $TARGET_URL --target-api-token $TARGET_API_TOKEN --require-valid-certificate $REQUIRE_VALID_CERTIFICATE
For additional deployment options, see the command below.
dynatrace-aws-logs.sh deploy --target-url <your_API_URL> --target-api-token <your_API_token> [--require-valid-certificate {true|false}] [--stack-name <your_stack_name>] [--max-log-length <max_log_content_length>] [--tags <value> [<value>...] ]
For a complete list of parameters, see the deploy table below.
--target-url
TARGET_URL
https://<your_activegate_IP_or_hostname>:9999/e/<your_environment_ID>
<your_environment_ID>
, see environment ID.--require-valid-certificate
REQUIRE_VALID_CERTIFICATE
true
, the log forwarder Lambda function verifies the SSL certificate of your Dynatrace environment URL.false
--stack-name
STACK_NAME
dynatrace-aws-logs
--max-log-length
MAX_LOG_CONTENT_LENGTH
8192
--tags
TAGS
You can use the verification methods provided below to fix an unsuccessful deployment process.
To verify deployment correctness
dynatrace-aws-logs
).CREATE_COMPLETE
.To verify AWS log forwarder connectivity and inspect operational logs
DynatraceLogForwarder-SelfMonitoring-eu-north-1-dynatrace-aws-logs
, where the middle part is the AWS region and the last part is the stack name you chose (the default is dynatrace-aws-logs
).dynatrace-aws-logs
).Lambda
.To scale up the default throughput, we recommend increasing the Lambda Function's memory and the number of provisioned instances to run concurrently. The values to use depend on the actual load. The following are the maximum tested and supported values.
15 MB/minute
(1 GB/hour)256 MB
1
500 MB/minute
(30 GB/hour)1024 MB
5
As a last resort, scale horizontally: deploy more integrations and subscribe each of them to different log groups to distribute the load.
To uninstall AWS log forwarding
DeliveryBucket
S3 bucket.