Log Management Fundamentals Certification / 02 / 06

Log Collection

What this domain covers

In this domain, you learn the entry-point configuration for bringing logs into Datadog. There are 4 pillars. First, enabling log collection: logs_enabled in the Agent, the logs configuration in conf.d, Docker labels, and Kubernetes annotations. Second, filtering and obfuscation: log_processing_rules on the Agent side and Sensitive Data Scanner on the Datadog side. Third, processors and pipelines: preprocessing for JSON logs, integration pipelines, and processor precedence. Fourth, standard attributes: reserved attributes, standard attributes, and aliases. The exam asks "which setting do you touch in this situation" and "why are the logs not arriving." The figures are based on the official documentation as of September 2026.

Topics listed in the official guide

  • Enabling Log Collection
  • Log Filtering & Obfuscation
  • Processors & Pipelines
  • Standard Attributes

Key points

  • Log collection in the Agent is disabled by default. Enable it with logs_enabled: true in datadog.yaml, and define the collection sources in the logs configuration in conf.d.
  • The type in a logs configuration is 1 of 6 kinds: file, tcp, udp, journald, windows_event, and docker. The required accompanying parameters change with the type.
  • source and service are required. Setting source to the integration name installs the pipeline automatically, and service should use the Unified Service Tagging value aligned with other products (cross-product correlation is out of scope for this exam).
  • The default source and service for containers is the short image name. Override them with labels on Docker and with annotations on Kubernetes.
  • containerCollectAll on Kubernetes defaults to false. Setting it to true collects the logs of every discovered container.
  • log_processing_rules are applied in order and use Golang regular expressions. To apply them to all logs, write them in logs_config.processing_rules.
  • Protect sensitive data with mask_sequences on the Agent side, or with Sensitive Data Scanner, which redacts during processing on the Datadog side.
  • A pipeline applies its processors in order to the logs that match its filter. The recommended limit is 20 processors per pipeline.
  • Integration pipelines are read-only and cannot be deleted. Edit them by cloning, and they are installed automatically when logs with that source arrive.
  • The reserved attributes are host, source, status, service, trace_id, and message. An alias maps to a standard attribute while keeping the original attribute.

Terms and concepts

Enabling log collection (logs_enabled and conf.d)

Even when the Agent is collecting metrics, log collection is disabled by default. On a host, set logs_enabled to true in datadog.yaml (the environment variable DD_LOGS_ENABLED=true also works) and write the collection sources in the logs block of conf.d/<SOURCE_NAME>.d/conf.yaml. Restart the Agent, and if the source name appears under Checks in the output of the status subcommand, it has been loaded. Log collection requires Agent v6.0 or later. To distribute the same configuration to many hosts, you can use Fleet Automation.

The logs configuration in conf.d (type, accompanying parameters, and read position)

type is file, tcp, udp, journald, windows_event, or docker; path is required for file and journald, port for tcp and udp, and channel_path for windows_event. Wildcards can be used in path, and exclude_paths removes specific files. start_position defaults to end, a saved offset takes precedence, and forceBeginning and forceEnd ignore the offset. encoding takes effect only for type: file.

Collecting from containers (Docker labels and Kubernetes annotations)

The logs that a container writes to stdout and stderr remain on Kubernetes as files under /var/log/pods on the node, and the Agent DaemonSet collects them from those files. This is the recommended method, more resource-efficient than going through the Docker socket. The source and service of container logs default to the short image name, and you override them with the Docker label com.datadoghq.ad.logs or the Kubernetes annotation ad.datadoghq.com/<CONTAINER_NAME>.logs. Annotations identify containers by name, not by image.

Agent-side filtering (exclude_at_match, include_at_match, and global processing rules)

To narrow down the logs sent on the Agent side, use log_processing_rules. exclude_at_match does not send logs that contain the specified pattern, and include_at_match sends only the logs that contain the specified pattern. When multiple include_at_match rules are listed, only lines that match every pattern remain, so combine them into 1 expression when you want a match on any one of them. Rules are applied in the order written, and patterns are Golang regular expressions. To apply them to all logs, write them in logs_config.processing_rules; if the format is wrong, the Agent does not start the log collector.

Agent-side obfuscation and multi-line aggregation (mask_sequences and multi_line)

To replace sensitive data in the Agent, use mask_sequences. The matched group is replaced with the string in replace_placeholder, and on Agent 7.17 or later you can reference capture groups with $1 or ${2}. To aggregate a non-JSON stack trace into 1 log, specify with multi_line a pattern that marks the start of a new log (such as a leading date). The pattern must match the beginning of the log, and a pattern that never matches can cause log loss. In labels and annotations the value is in JSON syntax, and \d is escaped as \\d.

Sensitive Data Scanner (Datadog-side obfuscation)

Sensitive Data Scanner is the means of protecting sensitive data without touching the configuration of the Agent or the application. On the cloud side, it scans and redacts logs during processing in the Datadog backend, so sensitive data can be redacted before it is indexed and displayed in the UI. Note, however, that the data is redacted after it has left your environment. It covers the entire content including the message and attribute values, and the action is chosen from Redact, Partially redact, Hash, and Mask. It is configured with scanning groups and scanning rules (predefined rules from the library or custom regular expressions).

Pipelines and preprocessing for JSON logs

Datadog parses JSON logs automatically and structures everything else with pipeline processors. A log is matched against the filters of every pipeline, and all of the processors of a matching pipeline are applied in order before moving on to the next. Because the filter is evaluated before the processors, you cannot narrow down by an attribute extracted in that pipeline. The preceding "preprocessing for JSON logs" assigns reserved attributes, and this preprocessing is the only place where a JSON attribute can be made the host. Integration logs are parsed automatically by read-only pipelines, which you edit by cloning.

Processor chaining, precedence, and nested pipelines

A processor performs 1 structuring action within a pipeline. The Grok Parser extracts attributes from semi-structured text, the Date, Status, Service, and Message Remappers assign reserved attributes, and the Attribute Remapper, Category Processor, and others create attributes. When multiple processors set the same attribute, the outcome depends on the kind: for the Grok Parser and similar processors the later write wins, the Attribute Remapper follows override_on_conflict (default false), and remappers such as Status use the first write (only Date uses the last). A nested pipeline can contain only processors.

Reserved attributes, standard attributes, and aliases

The reserved attributes, ingested automatically, are host, source, status, service, trace_id, and message. Standard attributes are the backbone of an organization's naming convention, consolidating attributes that vary, such as clientIP and remote_address, into a single name like network.client.ip. The default standard attributes are grouped into areas by prefixes such as network, http, logger, error, db, usr, and syslog. An alias maps a source attribute to a standard attribute, and the log keeps both. It works after pipeline processing, and changes apply only to new logs.

Out of scope for this domain

The official exam guide places Cross-product Applications of Logs and Observability Pipelines out of scope. Preprocessing includes the assignment of trace_id and span_id, and the processors include the Trace ID Remapper and the Span Remapper, but these serve the out-of-scope purpose of correlating logs and traces, so they are not asked. The "redact within your environment" path of Sensitive Data Scanner is also Observability Pipelines and out of scope. In your study, focus on how logs are collected, how they are filtered, how they are structured, and which attribute names they are aligned to.

Check your understanding

Check what you have learned with 5 questions