Getting Started with Datadog Log Collection - Where conf.d Trips You Up
This article sorts out the order of checks when logs do not arrive, the role of each key in the logs: block of conf.d (type / path / source / service), the log_processing_rules that reduce volume on the Agent side before sending, and the snags around multi-line logs, character encodings, and permissions. Processing after arrival is left to the glossary pages.
About 11 min read
The order of checks when logs do not arrive is fixed
There are three routes by which logs enter Datadog, the Agent / cloud integrations / the API, and the overall picture is left to the Log Management explanation. This article covers only the route through the Agent installed on a host. The official troubleshooting guide lists four configuration checkpoints it says are worth confirming carefully, and if you go through them in order, the majority of causes are found here (as of September 2026; source: Log Collection Troubleshooting Guide).
1. api_key is present in datadog.yaml
2. In the same file, logs_enabled: true is set (the default is false)
3. There is at least one YAML file under conf.d/ containing a logs: section (without one, the Agent collects nothing)
4. There are no YAML syntax errors (the official docs recommend checking with a validation tool)
5. You restarted the Agent after changing the configuration
6. New lines were written after the Agent started reading (lines written before startup are not collected)
The sixth is an easily overlooked behavior: the Agent collects only lines written after the point at which it started reading. If you test on a quiet log file, it looks like "the configuration is correct but nothing arrives," so append one line when checking. If you still cannot tell, look at the Agent's own log.
sudo grep -i error /var/log/datadog/agent.log
Enable it in datadog.yaml, and write the targets in conf.d
Log collection configuration is split across two places. The switch is logs_enabled in datadog.yaml, or DD_LOGS_ENABLED=true as an environment variable (as of September 2026; source: Host Agent Log collection). What to collect is written in a logs: block in a file <CUSTOM_LOG_SOURCE>.d/conf.yaml that you create under conf.d/. For the locations and the division of roles, see the datadog.yaml glossary page. The minimal conf.yaml takes this form.
Among these, the ones hard to fix later are source and service. source is the key to the automatic application of log pipelines; if you enter an integration name such as postgresql, the parsing for that integration applies from the start. service, by being aligned with the APM service name, lets you move back and forth between logs and traces, and logs from any period in which they were not aligned lose the handle for cross-referencing.
Reduce before sending - log_processing_rules on the Agent side
There are two places to reduce log volume. log_processing_rules on the Agent side drop lines before they leave the host, so both transfer volume and ingested volume fall; exclusion filters and log indexes on the Datadog side act after arrival, so ingestion has already happened (as of September 2026; source: Advanced Log Collection Configurations).
Types of Agent-side log_processing_rules
type
Effect
When to use
exclude_at_match
Does not send lines matching the pattern
Dropping health check or debug lines
include_at_match
Sends only matching lines
You want only lines containing a specific string
mask_sequences
Replaces the matched portion with the value of replace_placeholder
Masking card numbers and the like before they leave
multi_line
Treats a line starting with the pattern as the beginning of a new log and bundles the rest
pattern is a regular expression. mask_sequences, which masks before sending, is the place on the Agent side where data can be removed before it reaches Datadog (for a pipeline product, Observability Pipelines).
Decide on multi-line logs and character encoding first
Multi-line logs are a common snag. By default the Agent treats one line as one log, so a Java stack trace arrives broken up line by line (as of September 2026; source: Advanced Log Collection Configurations). There are two fixes: if writing by hand, put a regular expression for "the line that begins a new log" (the official example is a date) in a multi_line rule; if there are many formats, add auto_multi_line_detection: true under logs_config in datadog.yaml and leave it to automatic detection (source: Host Agent Log collection).
Three defaults and settings that affect how lines are read
Item
Default
Setting
Multi-line
1 line = 1 log
A multi_line rule, or auto_multi_line_detection: true
Character encoding
UTF-8
utf-16-le / utf-16-be (Agent 6.23 / 7.23 onward) or shift-jis (6.34 / 7.34 onward) in encoding. Unsupported values are ignored and treated as UTF-8
Line ending
Only lines ending in a newline (\n or \r\n) are sent
A line without a newline is held by the Agent and not sent
Shift-JIS files emitted by Windows-based applications are read as UTF-8 unless the single encoding line is present, and arrive as lines with the Japanese portions garbled. The character encoding of the target file is something to confirm before writing conf.yaml.
Permissions, containers, and limits on the receiving side
The Agent does not run as root; it reads as the user datadog-agent on Linux and macOS and ddagentuser on Windows (as of September 2026; source: Log Collection Troubleshooting Guide). If that user cannot read the file, a "file does not exist" type of error appears in agent status. Container logs are specified not through the conf.d in this article but through labels on Docker and through values and annotations on Kubernetes, so they are left to the Docker article and the Kubernetes article. Logs from AWS services take the Datadog Forwarder or Data Firehose route, which the AWS integration article handles.
Limits on the receiving side (official statements as of September 2026)
Item
Limit
Tags per log
Up to 100, each tag up to 256 characters
Attributes when converted to JSON
Fewer than 2,048. Keys under 50 characters, nesting under 20 levels
Timestamp
Logs with a time earlier than 18 hours ago are not accepted
Attributes with null values
Not retained
Destination
The HTTPS endpoint (443) for each site. The Agent uses an encrypted route
The timestamp limit matters when bulk-loading old logs. Because lines earlier than 18 hours ago are not accepted, past data requires a different method.
What you should see when it has succeeded, and what to decide next
Success is judged in three stages. Your <CUSTOM_LOG_SOURCE> appears under Checks in agent status with no warnings. After a new line is written to the target file, that log can be found in Log Explorer from the source or service facet. And for logs whose source is an integration name, the attributes for that integration are attached (as of September 2026; source: Host Agent Log collection).
1. The configuration name appears under Checks in agent status
2. After writing a new line, it is found via the source / service facet in Log Explorer
3. The attributes of the standard pipeline matching the source are attached
4. If there are unexpectedly many or missing lines, suspect Agent-side exclusions or permissions
Once logs start arriving, the next thing to decide is the volume design. Because the bill is determined by how many GB you send and how much you keep in indexes, get a grip on the counting rules in the log pricing article, then combine Agent-side exclusions with post-arrival exclusion filters. If you have not yet installed the Agent on the host, start from the Linux installation article.