Log Monitoring Classic
You can send logs to Dynatrace using Fluent Bit, a multiplatform log processor and forwarder. Fluent Bit collects logs from your hosts or applications and sends them to the Dynatrace OpenTelemetry logs ingest API through its opentelemetry output plugin, or to the Log ingestion API through its http output plugin. Fluent Bit is the recommended solution whenever reducing resource consumption is critical.
The configurations on this page are based on Fluent Bit 4.2. Settings may differ in other Fluent Bit versions.
If you run Fluent Bit in Kubernetes, see Stream Kubernetes logs with Fluent Bit (Logs Classic) instead.
logs.ingest (Ingest Logs) scope.host, port, and logs_uri fields in Key fields.Use this configuration when your application writes log files into a dedicated directory, such as /var/log/myapp. It sends logs with the opentelemetry output plugin and leaves JSON parsing to Dynatrace.
/var/log/myapp/*.log.app_name attribute to identify the application.Set the following environment variables for the Fluent Bit process. Fluent Bit expands them in the configuration file at startup, so you never need to write the token into the file.
DT_HOST: The domain of your Dynatrace Managed cluster, for example, {your-domain}.DT_ENVIRONMENT_ID: Your environment ID.DT_API_TOKEN: Your access token.Create the parser file parsers-otlp.yaml in the same directory as your Fluent Bit configuration file:
parsers:- name: extract_timestampformat: regexregex: '(?i)^.*?"(?:timestamp|@timestamp|_timestamp|eventtime|date|published_date|syslog\.timestamp|time|startTime|datetime|ts|@t)"\s*:\s*"(?<timestamp>[^"]+)"'time_key: timestamptime_format: '%Y-%m-%dT%H:%M:%S.%LZ'time_keep: Off- name: extract_levelformat: regexregex: '(?i)^.*?"(?:loglevel|status|severity|level|syslog\.severity|log_level|log\.level|@l|SeverityText|lvl|levelname)"\s*:\s*"(?<level>[^"]+)"'- name: jsonformat: jsontime_key: timestamptime_format: '%Y-%m-%dT%H:%M:%S.%LZ'time_keep: Off
Create the Fluent Bit configuration file, for example, fluent-bit.yaml:
service:parsers_file: parsers-otlp.yamlpipeline:inputs:- name: tailpath: /var/log/myapp/*.logpath_key: log.file.pathread_from_head: truerefresh_interval: 5filters:- name: parsermatch: '*'key_name: logparser: extract_timestampreserve_data: truepreserve_key: true- name: parsermatch: '*'key_name: logparser: extract_levelreserve_data: truepreserve_key: true- name: record_modifiermatch: '*'record:- app_name myapplicationoutputs:- name: opentelemetrymatch: '*'host: ${DT_HOST}port: 443logs_uri: /e/${DT_ENVIRONMENT_ID}/api/v2/otlp/v1/logsheader:- Authorization Api-Token ${DT_API_TOKEN}tls: ontls.verify: onlogs_body_key: $loglogs_body_key_attributes: true
Validate the configuration file without starting Fluent Bit:
fluent-bit --dry-run -c /path/to/fluent-bit.yaml
If the configuration is valid, the output contains configuration test is successful. The dry run can report success even when the parser file can't be loaded, so also check the output for [error] lines.
Start Fluent Bit with the configuration file.
The configuration doesn't parse the log line as JSON on purpose. Avoid parsing JSON on the log shipper side and let Dynatrace handle it instead. This approach reduces processing overhead on your log shipper and ensures consistent parsing behavior with the OneAgent log module. If you want to parse JSON log lines in Fluent Bit, see JSON parsing.
service:
parsers_file: The path to your parsers-otlp.yaml. In this example, the file is in the same directory as the configuration file.parsers:
time_key, time_format, time_keep: Set the parsed timestamp as the event time of the record. The opentelemetry output plugin serializes it into the standard timeUnixNano field.json: Not used in this example. The JSON parsing alternative uses it.inputs:
name: tail reads log files line by line.path: Glob pattern of the log files to read.path_key: Optional. Adds the path of the log file to every record as the attribute log.file.path. See Semantic attributes (Logs Classic).read_from_head: Optional. For newly discovered files without a stored offset, reads from the beginning of the file instead of the end.refresh_interval: Optional. How often, in seconds, Fluent Bit scans for new files.filters:
parser: Two chained filters apply extract_timestamp and extract_level from parsers-otlp.yaml to extract the timestamp and the log level from the line.
Each regular expression matches, case-insensitively, any of the timestamp and log level keys that Dynatrace recognizes. If a line contains several of them, the first one in the line is used, which isn't necessarily the one that Dynatrace would prioritize.
The timestamp must be in RFC 3339 format with a trailing Z, for example, 2026-10-16T12:13:13.832Z. The parser has a fixed time_format, so epoch timestamps and timestamps with a time zone offset aren't parsed.
Because no JSON parsing is applied, Fluent Bit stores the whole original line under the log key, which logs_body_key selects as the log body.
record_modifier: Optional. Adds attributes to each record. See Enrich logs with context.
outputs:
name: opentelemetry sends records to an OpenTelemetry endpoint. To use the Log ingestion API instead, see HTTP output.
host: The domain of your Dynatrace Managed cluster, read from the DT_HOST environment variable. For an Environment ActiveGate, use the ActiveGate domain.
port: 443 for your Dynatrace Managed cluster. For an Environment ActiveGate, use 9999.
logs_uri: The path of the OpenTelemetry logs endpoint, including your environment ID from the DT_ENVIRONMENT_ID environment variable. The path is the same for an Environment ActiveGate.
If you omit this key, it defaults to /v1/logs, which isn't a valid Dynatrace endpoint. In this case, Fluent Bit may still report HTTP status=200, but no data arrives in Dynatrace. If logs are missing, check logs_uri first.
header: The Authorization header with your access token: Api-Token ${DT_API_TOKEN}.
tls and tls.verify: Turn on TLS and verify the server certificate.
logs_body_key: Selects which record field becomes the log body. Without JSON parsing, the original line is in the log field.
logs_body_key_attributes: Keeps all other fields as log attributes. Without it, every field except the body is discarded, including log.file.path and any attributes added by filters.
If you copy the sample line to try out the configuration, set timestamp to the current time. Records with an event time older than the log age limit are discarded.
The original line that the application wrote to /var/log/myapp/file.log:
{"timestamp": "2026-10-16T12:13:13.832Z","sequence": 174,"loggerClassName": "org.jboss.logmanager.Logger","loggerName": "com.myapplication.cache.CacheService","level": "INFO","message": "Cache miss for key 'product:catalog:v2', fetching from origin","threadName": "pool-1-thread-1","threadId": 30,"mdc": { "requestId": "req-7f3a9b2c", "service": "myapplication" },"ndc": "","hostName": "app-server-prod.example.com","processName": "myapplication.jar","processId": 152775}
The resulting log record in Dynatrace:
{"timestamp": "2026-10-16T12:13:13.832000000Z","content": "{\"timestamp\":\"2026-10-16T12:13:13.832Z\",\"sequence\":174,\"loggerClassName\":\"org.jboss.logmanager.Logger\",\"loggerName\":\"com.myapplication.cache.CacheService\",\"level\":\"INFO\",\"message\":\"Cache miss for key 'product:catalog:v2', fetching from origin\",\"threadName\":\"pool-1-thread-1\",\"threadId\":30,\"mdc\":{\"requestId\":\"req-7f3a9b2c\",\"service\":\"myapplication\"},\"ndc\":\"\",\"hostName\":\"app-server-prod.example.com\",\"processName\":\"myapplication.jar\",\"processId\":152775}","loglevel": "INFO","status": "INFO","app_name": "myapplication","log.file.path": "/var/log/myapp/file.log","dt.auth.origin": "dt0YYY.XXXXXXXXXXXXXXXXXXXXXXXX"}
Dynatrace adds dt.auth.origin, which holds the identifier of the token used for ingestion.
With the example configuration, log records in Dynatrace have the same structure as those ingested by the OneAgent log module. This keeps your log data consistent and simplifies migration between the two integrations.
{"content": "{\"timestamp\":\"2026-10-16T12:13:13.832Z\",\"sequence\":174,\"loggerClassName\":\"org.jboss.logmanager.Logger\",\"loggerName\":\"com.myapplication.cache.CacheService\",\"level\":\"INFO\",\"message\":\"Cache miss for key 'product:catalog:v2', fetching from origin\",\"threadName\":\"pool-1-thread-1\",\"threadId\":30,\"mdc\":{\"requestId\":\"req-7f3a9b2c\",\"service\":\"myapplication\"},\"ndc\":\"\",\"hostName\":\"app-server-prod.example.com\",\"processName\":\"myapplication.jar\",\"processId\":152775}","timestamp": "2026-10-16T12:13:13.832000000Z","loglevel": "INFO","status": "INFO","level": "INFO","log.source": "/var/log/myapp/file.log","host.name": "app-server-prod.example.com","process.technology": ["Java"],"dt.process_group.detected_name": "myapplication.jar","dt.process_group.id": "PROCESS_GROUP-59CF50BFC1532D0B","dt.entity.host": "HOST-123456789CDA1660","dt.entity.process_group_instance": "PROCESS_GROUP_INSTANCE-C98765BDEA123456","dt.source_entity": "PROCESS_GROUP_INSTANCE-C98765BDEA123456"}
content: The whole original line is preserved as content in both cases.loglevel and timestamp: The OneAgent log module derives them by scanning the raw, unparsed line itself, within a fixed window. See Automatic log enrichment (Logs Classic) and Timestamp/splitting configuration (Logs Classic).The example configuration covers the most common setup. Use one of the following alternatives if you want to send logs to the Log ingestion API instead of the OpenTelemetry endpoint, or if you want Fluent Bit to parse JSON log lines before sending them.
Use this configuration to send logs to the Log ingestion API with the Fluent Bit http output plugin instead of the opentelemetry output plugin. The access token needs the same scope. The sample log line is the same as in the example configuration.
/var/log/myapp/*.log.app_name attribute to identify the application.Create the parser file parsers.yaml in the same directory as your Fluent Bit configuration file:
parsers:- name: extract_timestampformat: regexregex: '(?i)^.*?"(?:timestamp|@timestamp|_timestamp|eventtime|date|published_date|syslog\.timestamp|time|startTime|datetime|ts|@t)"\s*:\s*"(?<timestamp>[^"]+)"'- name: extract_levelformat: regexregex: '(?i)^.*?"(?:loglevel|status|severity|level|syslog\.severity|log_level|log\.level|@l|SeverityText|lvl|levelname)"\s*:\s*"(?<level>[^"]+)"'
Create the Fluent Bit configuration file:
service:parsers_file: parsers.yamlpipeline:inputs:- name: tailpath: /var/log/myapp/*.logpath_key: log.file.pathread_from_head: truerefresh_interval: 5filters:- name: parsermatch: '*'key_name: logparser: extract_timestampreserve_data: truepreserve_key: true- name: parsermatch: '*'key_name: logparser: extract_levelreserve_data: truepreserve_key: true- name: record_modifiermatch: '*'record:- app_name myapplicationoutputs:- name: httpmatch: '*'host: ${DT_HOST}port: 443uri: /e/${DT_ENVIRONMENT_ID}/api/v2/logs/ingestheader:- Authorization Api-Token ${DT_API_TOKEN}allow_duplicated_headers: falseformat: jsonjson_date_key: falsetls: ontls.verify: on
parsers_file: The path to your parsers.yaml. Unlike parsers-otlp.yaml, it sets no time_* fields, so the parsed timestamp stays an ordinary field.
parser filters: Extract the timestamp and the log level the same way as in the example configuration. Dynatrace recognizes both keys, so they become the timestamp and the log level of the record. Without these filters, no timestamp is sent and Dynatrace uses the time it received the log.
Because no JSON parsing is applied, Fluent Bit stores the whole original line under the log key, which the Log ingestion API maps to content. See Content.
name: http instead of opentelemetry.
uri: The path of the Log ingestion API endpoint, including your environment ID. The path is the same for an Environment ActiveGate.
format: json sends each batch of records as a JSON array.
json_date_key: The name of the key under which Fluent Bit adds its own date field to each record. false turns this field off, so the timestamp extracted from the line is used. This works when every log format you read emits its own timestamp under one of the supported timestamp keys.
If your logs don't contain a timestamp, you can keep false, and Dynatrace uses the time of ingestion. Alternatively, set json_date_key: timestamp so that Fluent Bit adds the time it read the record as timestamp, and add json_date_format: iso8601 to format it as an ISO 8601 string. json_date_format only takes effect together with json_date_key, so don't set it on its own.
The resulting log record is the same as with the example configuration.
Use these configurations when your application writes JSON log lines and you want Fluent Bit to parse them before sending. The log files and the sample log line are the same as in the example configuration.
This configuration uses the json parser from the same parsers-otlp.yaml file as the example configuration.
service:parsers_file: parsers-otlp.yamlpipeline:inputs:- name: tailpath: /var/log/myapp/*.logparser: jsonpath_key: log.file.pathread_from_head: truerefresh_interval: 5filters:- name: record_modifiermatch: '*'record:- app_name myapplicationoutputs:- name: opentelemetrymatch: '*'host: ${DT_HOST}port: 443logs_uri: /e/${DT_ENVIRONMENT_ID}/api/v2/otlp/v1/logsheader:- Authorization Api-Token ${DT_API_TOKEN}tls: ontls.verify: onlogs_body_key: $messagelogs_body_key_attributes: true
Key differences from the example configuration:
parser: Set on the input. json parses each line as a structured JSON object and sets the timestamp key as the event time of the record. The parser filters aren't needed.logs_body_key: $message, because after JSON parsing the log message is in the message field.This configuration uses the json parser from the parsers.conf file that ships with Fluent Bit.
service:parsers_file: /etc/fluent-bit/parsers.confpipeline:inputs:- name: tailpath: /var/log/myapp/*.logparser: jsonpath_key: log.file.pathread_from_head: truerefresh_interval: 5filters:- name: record_modifiermatch: '*'record:- app_name myapplicationoutputs:- name: httpmatch: '*'host: ${DT_HOST}port: 443uri: /e/${DT_ENVIRONMENT_ID}/api/v2/logs/ingestheader:- Authorization Api-Token ${DT_API_TOKEN}allow_duplicated_headers: falseformat: jsonjson_date_key: falsetls: ontls.verify: on
Key differences from the example configuration:
parsers_file: Required. This key has no default, and when you start Fluent Bit with your own configuration file, the packaged configuration that normally loads parsers.conf isn't used. Without this line, parser: json can't be resolved. The stock parsers.conf already defines a json parser, so you don't need to write one. Check where parsers.conf is in your installation. On Linux, it's usually at /etc/fluent-bit/parsers.conf. In the official Docker image, it's at /fluent-bit/etc/parsers.conf.parser: Set on the input. json parses each line as a structured JSON object. The parser filters aren't needed, because the input already parses each line.In the resulting log record, content contains only the value of the message key of the log line, and every other key becomes its own attribute. Attribute keys are converted to lowercase, and nested objects, such as mdc, are transformed into separate attributes. See Attributes.
Ingested logs aren't enriched automatically. Attributes are stored exactly as sent. Dynatrace doesn't infer a host from an IP address, a hostname, or a file path. Anything that Fluent Bit doesn't send is missing, and the logs don't appear on the pages of the corresponding host or process.
This is the main practical difference from logs collected by the OneAgent log module, which arrive already linked to a host, process group, and cloud instance.
A filter isn't the only way to add attributes. The Log ingestion API also accepts attributes as query parameters, which saves a filter when the value is the same for every record that Fluent Bit sends. You can use environment variables in all of them, which Fluent Bit expands at startup.
| What you need | Use |
|---|---|
| One value for everything this Fluent Bit instance sends | A query parameter on the uri of the http output. |
| A value that differs per host or deployment | The same, with an ${ENV_VAR} environment variable set per machine. |
| A value that differs per record | A record_modifier filter. |
If OneAgent is installed on the host, you can link your logs to the host entity, so that they appear on the pages of the host.
Get the host ID on the host. See Host ID.
./oneagentctl --get-host-id
Get the host ID once, in a privileged step that runs before Fluent Bit starts, and let Fluent Bit only read an environment variable.
Prefix the ID with HOST-. For example, if the command returns 115394726CDA1660, the host ID is HOST-115394726CDA1660.
Store the host ID in an environment variable, for example, DT_HOST_ID, and add it to the records as dt.entity.host and dt.source_entity.
For example, to link the logs to the host, add the hostname, and add constant region and team attributes, extend the HTTP output configuration as follows. The example assumes that the DT_HOST_ID and HOSTNAME environment variables exist.
pipeline:filters:- name: record_modifiermatch: '*'record:- dt.entity.host ${DT_HOST_ID}- dt.source_entity ${DT_HOST_ID}- hostname ${HOSTNAME}outputs:- name: http# ...# Example of adding context via query parameters:uri: /e/${DT_ENVIRONMENT_ID}/api/v2/logs/ingest?region=eu-central-1&team=core
&, =, #, or a non-ASCII character, or it's misinterpreted on arrival.match: '*' in filters, or set a tag on the input and match it exactly. If a filter silently matches a tag you never assigned, it adds nothing; this is a common cause of missing attributes.opentelemetry output, these attributes are only kept if logs_body_key_attributes: true is set.For details and precedence rules, see Log ingestion API attribute handling.
Nothing in this section is required to send logs to Dynatrace. It covers what happens when something fails: a slow endpoint, a restart, or a sustained outage. The Fluent Bit defaults are fine for trying things out. Review them before you run Fluent Bit long-term. The right values depend on your log volume and how much data loss you can accept, so each section links to the Fluent Bit documentation instead of prescribing values.
Some response codes of the Log ingestion API are retryable with an exponential backoff strategy. See Response code.
By default, Fluent Bit retries a failed delivery once (retry_limit: 1), after a wait that grows exponentially with jitter between scheduler.base and scheduler.cap, both set in service. For the backoff formula and how to change the limits, see Scheduling and retries in the Fluent Bit documentation.
By default, each input buffers only in memory. If Fluent Bit restarts while data is queued, that data is lost. Filesystem buffering (storage.type: filesystem on the input, plus storage.path in service) survives a restart, at the cost of disk I/O.
For the available modes and how to size them, see Buffering and storage in the Fluent Bit documentation.
Backpressure occurs when Fluent Bit takes in data faster than it can send it. With memory buffering, mem_buf_limit caps how much a single input can hold before it pauses. With filesystem buffering, storage.max_chunks_up and storage.backlog.mem_limit cap memory use across all plugins, and storage.pause_on_chunks_overlimit decides whether disk buffering continues once that cap is reached.
For how each buffering mode behaves once its limit is reached, see Backpressure in the Fluent Bit documentation.
The dead letter queue is turned off by default. When you turn it on (storage.keep.rejected: on, which requires filesystem buffering), chunks that exhaust their retries are copied to a rejected subdirectory instead of being discarded, so you can inspect what failed and why.
There is no size limit on this directory, and files remain on disk until you remove them. Monitor its disk usage and set up a cleanup policy for older files.
See Dead letter queue in the Fluent Bit documentation, including how to read the rejected files.
In the following example, you 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.
For the response codes that the Log ingestion API returns and which of them are retryable, see Response code. For the reasons why logs are dropped and how to resolve them, see Troubleshooting Log Monitoring (Logs Classic).
Common causes of missing logs or attributes:
opentelemetry output: A missing or wrong logs_uri. See Key fields.match that doesn't match the input tag, or logs_body_key_attributes not set with the opentelemetry output.For more troubleshooting guidance, see Troubleshooting logs ingested via Fluent Bit in the Dynatrace Community.