You can send logs to Dynatrace using Fluent Bit. Configure Fluent Bit to send logs to Dynatrace generic ingest API.
http output
.The Fluent Bit http output
plugin allows you to forward your logs to the Dynatrace generic logs ingest endpoint.
logs.ingest
(Ingest Logs) scope.[OUTPUT]name httpmatch *header Content-Type application/json; charset=utf-8header Authorization Api-Token {your-API-token-here}allow_duplicated_headers falsehost {your-environment-id}.live.dynatrace.comPort 443URI /api/v2/logs/ingestFormat jsonjson_date_format iso8601json_date_key timestamptls Ontls.verify On
You can place your API token in the header or as GET
variable in URI (see example below).
Fluent Bit is the recommended solution whenever reducing resource consumption is critical. In the below example, you need to ingest your AWS Fargate logs. FireLens enables you to set up Fluent Bit for this ingestion.
When creating a new task definition using the AWS Management Console, the FireLens integration section makes it easy to add a log router container. Follow the steps below to execute your ingest:
The settings for the log driver should point to the log ingest API of your SaaS tenant. You need to provide two headers for Fluent Bit: content type and authorization token. As FireLens supports only one header, you can pass the token as part of the URL. Your configuration for AWS FireLens should have the following:
Name: httpTLS: onFormat: jsonHeader: Content-Type application/json; charset=utf-8Host: {your-environment-id}.live.dynatrace.comPort: 443URI: /api/v2/logs/ingest?api-token={your-API-token-here}Allow_Duplicated_Headers": "false"Json_Date_Format": "iso8601"Json_Date_Key": "timestamp"
To avoid publishing the token in plaintext, follow the directions from AWS Secrets Manager. Once your application starts publishing logs, you can view them in the Dynatrace UI.
Refer to AWS sample repository for the task definition JSON with Dynatrace configuration.
For more configuration details, see Amazon ECS Developer Guide.