Log Management Fundamentals Certification / 06 / 06

Log Troubleshooting

What this domain covers

In this domain, you learn the procedure for isolating ingestion problems, such as logs you thought you sent not appearing in Datadog, times being shifted, or logs being cut off partway, working in order from the Agent side toward the intake side. First, check the Agent's logs_enabled and the conf.d configuration, the Logs Agent section of agent status, and the read permissions on the log files. On the Datadog side, check in Live Tail whether the logs are arriving, and if they arrive but are missing from Log Explorer, suspect exclusion filters, the order of the indexes, daily quotas, and data access restrictions. Also cover the accepted range for timestamps, the recognized date formats, and truncation caused by the per-log limit. The exam asks questions such as "Where do you look first for this symptom?", "What does this status output mean?", and "Which metric do you use to identify the scope of impact?"

Topics listed in the official guide

  • Ingestion Issues

Key points

  • The Agent collects nothing by default. It needs logs_enabled: true and at least one conf.d configuration with a logs section, and changes do not take effect until a restart.
  • "Logs Agent is not running" is the sign that collection is disabled. If Integrations is empty and the processed and sent counts are 0, no collection source has been specified.
  • The Agent does not run as root. The default user is datadog-agent on Linux and ddagentuser on Windows. It needs read permission and execute permission along the path.
  • The Agent collects only the lines written after it started collecting. If nothing arrives even though the status is OK, first confirm that new logs were actually written.
  • Timestamps more than 18 hours in the past or more than 2 hours in the future are not accepted at intake. Identify the impact with the drop_count metric.
  • The recognized date formats are three: ISO8601, UNIX (epoch in milliseconds), and RFC3164. Formats that look similar but do not match (such as an epoch in nanoseconds) can be dropped.
  • Epoch timestamps are interpreted as UTC by default. Logs emitted in another time zone are displayed shifted into the past or the future by the difference from UTC.
  • If logs appear in Live Tail but are missing from Log Explorer, suspect exclusion filters and index filters. If datadog_index is N/A, no index matched.
  • Logs over 1 MB are truncated. In indexed logs, message is cut at 75 KiB and other fields at 25 KiB, and the truncated version appears only in grouped displays.
  • If you alone cannot see any logs at all, suspect a restriction query on your role or Legacy Permissions, and check with an administrator.

Terms and concepts

Order of Isolation (from the Agent Side to the Intake Side)

"Logs are not showing up" has many layers of possible causes, so you eliminate them in order starting from the nearest. The first layer is the Agent configuration: confirm logs_enabled: true, a conf.d configuration with a logs section, and a restart after the change. The second layer is the Logs Agent section of agent status and errors in the Agent log. The third layer is the Datadog side: check whether the logs are flowing in Live Tail. If they are flowing, ingestion has succeeded, and the remaining causes are exclusion filters, index filters, daily quotas, and access restrictions. If they are not flowing, suspect an out-of-range timestamp or the transport path.

How to Read the Logs Agent Section of agent status

In the Logs Agent section of agent status, when things are healthy, the transport path, the processed count, and the sent count are listed, and Integrations shows the type, path, service, source, and status for each collection source. "Logs Agent is not running" is the sign that collection is disabled. If Integrations is empty and the processed and sent counts are 0, collection is enabled but no collection source has been specified. For file tailing, a count such as "1 files tailed out of 1 files matching" is shown. In containers, agent configcheck and agent stream-logs are also available.

File Permissions and journald Permissions

The Agent does not run as root, and the official documentation does not recommend it. The default user is datadog-agent on Linux and macOS and ddagentuser on Windows. If it cannot read a file, a permission error such as "Access is denied" appears in the status. The fix is to grant the Agent user read permission on the file and execute permission on the directories along the path. For journald, add the Agent user to the systemd group. With incorrect permissions, journald returns an empty payload, and nothing arrives without any error being shown.

Accepted Timestamp Range and Recognized Date Formats

The intake discards logs whose timestamp is more than 18 hours in the past. The Date Remapper documentation states explicitly that the accepted range is from 18 hours in the past to 2 hours in the future. Discarded logs do not appear in Live Tail either. Identify the scope of impact by filtering the drop_count metric by service and source. The recognized date formats are three: ISO8601, UNIX epoch in milliseconds, and RFC3164, and a value that looks similar but does not match, such as an epoch in nanoseconds, can be discarded. For an epoch in seconds, multiply by 1000 with an Arithmetic Processor and make it the official timestamp with a Date Remapper.

Time Zone Offsets and Displayed Times

Timestamps are stored in UTC and displayed in the user's local time zone. First check the Time zone in Preferences. Because Datadog interprets epochs as UTC by default, logs that a UTC-5 host emitted in local time appear 5 hours in the past. To fix this, add the timezone parameter to the date matcher in the Grok Parser and confirm that the Date Remapper uses that attribute. If the time is stored in a custom attribute name in JSON, add it to the top of the date attribute list in preprocessing. Pipeline changes apply only to new logs.

Appears in Live Tail but Missing from Log Explorer

Because Logging without Limits separates ingestion from indexing, logs that were ingested do not appear in Log Explorer unless they are indexed. The typical causes when logs are visible in Live Tail but missing from Log Explorer are overly broad exclusion filters and index filters. If you exclude with a free-text search on a short string, parsed and unparsed JSON can match in unexpected ways and drop entire logs. The next thing to suspect is the daily quota, whose hallmark is that only today's logs are missing. Search Event Explorer for the datadog_index tag to see the history of when it was reached.

Identifying the Scope of Impact with Estimated Usage Metrics

When the volume differs from what you expect, use the estimated usage metrics. ingested_events can be filtered by the tags datadog_index, datadog_is_excluded, service, and status, letting you trace which index ingested or excluded which logs. A data point whose datadog_index is N/A means logs that matched no index, and it is grounds for reviewing the order and filters of the indexes. You can identify the source of impact for drops with drop_count and for truncation with truncated_count and truncated_bytes. Daily quotas, however, are not reflected.

The Two Stages of Truncation

Truncation happens in two stages. The first stage is at ingestion, where logs exceeding 1 MB are truncated. Check the source of impact with the truncated_count and truncated_bytes metrics and keep the size down at the sender. The second stage is per field on indexed logs, where the part of message exceeding 75 KiB and the part of other fields exceeding 25 KiB is cut. The full text is stored, however, and the normal list in Log Explorer shows the full text. The truncated version appears only when displaying with a group-by query, such as grouping by that field, and it is not a configuration defect.

Pitfalls in Container Environments (File Method and Socket Method)

For container log collection, the file method is the default and the official recommendation. With Docker's json-file driver, standard output is written under /var/lib/docker/containers, and in Kubernetes under /var/log/pods. If the Agent cannot read these, it switches to the socket method and the status shows "falling back to socket". The remedy is to mount the log directory into the Agent container as read-only. If lines are being split, check whether the Docker logging driver is JSON.

Data Access Restrictions and Fixed Transport Paths

If you alone cannot see logs in either Log Explorer or Live Tail, your role may be subject to a restriction query. A restriction query is a mechanism that narrows the visible scope; only one is attached per role, and roles with Unrestricted Access are not restricted. Legacy Permissions may also be restricting access per index, so check with an administrator. On the transport path, the Agent performs an HTTPS connection test only once at startup; if it fails, the Agent switches to TCP and does not switch back until the next restart.

Check your understanding

Check what you have learned with 5 questions