|
| 1 | +--- |
| 2 | +title: Log Agent tags |
| 3 | +further_reading: |
| 4 | +- link: "/getting_started/tagging/" |
| 5 | + tag: "Documentation" |
| 6 | + text: "Tagging Best Practices" |
| 7 | +- link: "/agent/configuration/agent-configuration-files/" |
| 8 | + tag: "Documentation" |
| 9 | + text: "Agent Configuration Files" |
| 10 | +- link: "/agent/docker/tag/" |
| 11 | + tag: "Documentation" |
| 12 | + text: "Container Tagging" |
| 13 | +--- |
| 14 | + |
| 15 | +## Overview |
| 16 | + |
| 17 | +The Datadog Agent automatically adds certain tags to all logs it collects before sending them to Datadog. These tags are added **pre-ingestion**, and are included in the payload that gets delivered to Datadog. |
| 18 | + |
| 19 | +## Pre-ingestion processing |
| 20 | + |
| 21 | +Since these tags are added pre-ingestion, they: |
| 22 | + |
| 23 | +* Are included in all log data delivered to Datadog |
| 24 | +* Increase the overall size of your log data |
| 25 | +* Are available for filtering, searching, and aggregation in the Log Explorer |
| 26 | +* Can be used in log-based metrics and queries |
| 27 | + |
| 28 | +## Agent tags automatically added to logs |
| 29 | + |
| 30 | +The following tags are automatically added to logs by the Datadog Agent: |
| 31 | + |
| 32 | +| Tag | Description | Conditions | |
| 33 | +|-----|-------------|-------------| |
| 34 | +| `source` | The source of the log (file path, integration name, etc.) | Always when available | |
| 35 | +| `service` | The service name if configured in the log collection | Always when available | |
| 36 | +| `env` | The environment tag if configured globally | Always when available | |
| 37 | +| `version` | The Agent version | Always when available | |
| 38 | +| `filename` | Base name of the tailed file | File-based sources only | |
| 39 | +| `dirname` | Directory containing the tailed file | File-based sources only | |
| 40 | +| `source_host` | IP address of the socket source host | Socket sources (TCP/UDP) only | |
| 41 | +| `event_type` | Type of the Windows event | Windows events only | |
| 42 | +| `event_source` | Source of the Windows event | Windows events only | |
| 43 | +| `event_id` | Windows Event ID | Windows events only, if `tag_event_id: true` | |
| 44 | +| `sid` | Windows Security identifier | Windows events only, if `tag_sid: true` | |
| 45 | +| `truncated` | Source of truncation | If `logs_config.tag_truncated_logs: true` | |
| 46 | +| `multiline` | Source of multi-line aggregation | If `logs_config.tag_multi_line_logs: true` | |
| 47 | +| `aggregated_json` | Indicates that the log was aggregated from multiple JSON log entries | If `logs_config.auto_multi_line.tag_aggregated_json: true` | |
| 48 | + |
| 49 | +## Further reading |
| 50 | + |
| 51 | +{{< partial name="whats-next/whats-next.html" >}} |
| 52 | + |
0 commit comments