dd-logs
This skill enables agents to search, process, and archive Datadog logs using the pup command-line tool.
Identity proven by GitHub's verified organisation badge (DataDog, datadog-labs)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- Apache-2.0 (permissive)
- Pin
- e12596fpinned Oct 9, 2026
- Context cost
- about 1,200 tokenswhen the skill loads
- GitHub stars
- 1,028on datadog/pup
- Scripts
- None found
What it does
“Log management - search, pipelines, archives, and cost control.”
Generated summary from the skill's own text
This skill enables agents to search, process, and archive Datadog logs using the pup command-line tool. It supports querying logs with filters, creating processing pipelines with grok parsers and remappers, setting up cost-control exclusion filters, and configuring log archives for compliance storage.
When to use it
- Searching logs for errors or specific patterns across services
- Creating pipelines to parse and transform log data before indexing
- Reducing log costs by excluding high-volume or debug logs
- Archiving logs to cloud storage for compliance retention
When not to
- Real-time monitoring or alerting on logs
- Analyzing trace spans without log context
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add datadog/pup --skill dd-logsInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install datadog/pup dd-logs@e12596f1e1efbd00aad05519b4b0b68668b18861Installs the commit we checked (e12596f).
Copy by hand
Download the folder at e12596f and put it in .claude/skills/dd-logs for Claude Code and in .agents/skills/dd-logs for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install datadog@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "dd-logs" by Datadog. Source, pinned to commit e12596f1e1efbd00aad05519b4b0b68668b18861: https://github.com/datadog/pup/tree/e12596f1e1efbd00aad05519b4b0b68668b18861/skills/dd-logs 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/dd-logs/ for Claude Code and .agents/skills/dd-logs/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/datadog/dd-logs-pup
SKILL.md at the pin
---
name: dd-logs
description: Log management - search, pipelines, archives, and cost control.
metadata:
version: "1.0.0"
author: datadog-labs
repository: https://github.com/datadog-labs/agent-skills
tags: datadog,logs,logging,search,dd-logs
globs: "**/datadog*.yaml,**/*log*"
alwaysApply: "false"
---
# Datadog Logs
Search, process, and archive logs with cost awareness.
## Prerequisites
Datadog Pup (dd-pup/pup) should already be installed:
```bash
cargo install --git https://github.com/DataDog/pup
```
## Quick Start
```bash
pup auth login
```
## Search Logs
```bash
# Basic search
pup logs search --query="status:error" --from="1h"
# With filters
pup logs search --query="service:api status:error" --from="1h" --limit 100
# JSON output is the default
pup logs search --query="@http.status_code:>=500" --from="1h"
```
### Search Syntax
| Query | Meaning |
|-------|---------|
| `error` | Full-text search |
| `status:error` | Tag equals |
| `@http.status_code:500` | Attribute equals |
| `@http.status_code:>=400` | Numeric range |
| `service:api AND env:prod` | Boolean |
| `@message:*timeout*` | Wildcard |
### Trace IDs in Log Results
Logs that show a linked trace in the Datadog UI may not include `dd.trace_id` /
`dd.span_id` in API results. When a trace ID attribute is remapped for trace
correlation (via JSON preprocessing or a Trace Remapper processor), the source
attribute is removed and the value is stored as an internal attribute that the
Logs Search API does not return. The UI's "trace" link reads that internal
attribute, so UI and API results differ.
**This is expected Datadog Log Management behavior, not a pup bug or an
instrumentation problem.** Do not retry queries or change instrumentation to
"fix" it. Datadog is tracking making these values queryable (support reference
FRLOGSS-4306).
Workarounds until then:
- Emit the trace ID under a separate attribute that is not remapped (e.g.
`@custom.trace_id`) and query that.
- Pivot the other way: search spans by the log's service/time window via
`pup traces search`, or use the trace link in the Datadog UI.
## Pipelines
Process logs before indexing:
```bash
# List pipelines
pup obs-pipelines list
# Create pipeline (JSON)
pup obs-pipelines create --file pipeline.json
```
### Common Processors
```json
{
"name": "API Logs",
"filter": {"query": "service:api"},
"processors": [
{
"type": "grok-parser",
"name": "Parse nginx",
"source": "message",
"grok": {"match_rules": "%{IPORHOST:client_ip} %{DATA:method} %{DATA:path} %{NUMBER:status}"}
},
{
"type": "status-remapper",
"name": "Set severity",
"sources": ["level", "severity"]
},
{
"type": "attribute-remapper",
"name": "Remap user_id",
"sources": ["user_id"],
"target": "usr.id"
}
]
}
```
## ⚠️ Exclusion Filters (Cost Control)
**Index only what matters:**
```json
{
"name": "Drop debug logs",
"filter": {"query": "status:debug"},
"is_enabled": true
}
```
### High-Volume Exclusions
```bash
# Find noisiest log sources
pup logs search --query="*" --from="1h" | jq 'group_by(.service) | map({service: .[0].service, count: length}) | sort_by(-.count)[:10]'
```
| Exclude | Query |
|---------|-------|
| Health checks | `@http.url:"/health" OR @http.url:"/ready"` |
| Debug logs | `status:debug` |
| Static assets | `@http.url:*.css OR @http.url:*.js` |
| Heartbeats | `@message:*heartbeat*` |
## Archives
Store logs cheaply for compliance:
```bash
# List archives
pup logs archives list
# Archive config (S3 example)
{
"name": "compliance-archive",
"query": "*",
"destination": {
"type": "s3",
"bucket": "my-logs-archive",
"path": "/datadog"
},
"rehydration_tags": ["team:platform"]
}
```
## Log-Based Metrics
Inspect log-based metrics:
```bash
# List existing log-based metrics
pup logs metrics list
```
**⚠️ Cardinality warning:** Group by bounded values only.
## Sensitive Data
### Scrubbing Rules
```json
{
"type": "hash-remapper",
"name": "Hash emails",
"sources": ["email", "@user.email"]
}
```
### Never Log
```python
# In your app - sanitize before sending
import re
def sanitize_log(message: str) -> str:
# Remove credit cards
message = re.sub(r'\b\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}\b', '[REDACTED]', message)
# Remove SSNs
message = re.sub(r'\b\d{3}-\d{2}-\d{4}\b', '[REDACTED]', message)
return message
```
## Troubleshooting
| Problem | Fix |
|---------|-----|
| Logs not appearing | Check agent, pipeline filters |
| High costs | Add exclusion filters |
| Search slow | Narrow time range, use indexes |
| Missing attributes | Check grok parser |
| `dd.trace_id` missing but UI shows a trace | Expected: remapped trace IDs become internal attributes (see [Trace IDs in Log Results](#trace-ids-in-log-results)) |
## References/Documentation
- [Log Search Syntax](https://docs.datadoghq.com/logs/explorer/search_syntax/)
- [Pipelines](https://docs.datadoghq.com/logs/log_configuration/pipelines/)
- [Exclusion Filters](https://docs.datadoghq.com/logs/indexes/#exclusion-filters)
- [Archives](https://docs.datadoghq.com/logs/archives/)
From datadog/pup at e12596f, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at e12596fFiles
- SKILL.md5.2 KB · 6f4233001e42
1 file, 5.2 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at e12596fMore from Datadog
dd-code-generation
This skill enables agents to interact with Datadog through the pup CLI tool for immediate queries and operations, or generate code for integrating Datadog…
Claude Code, Codex, Cursor +3 · about 4.3K tokens · pinned 7 days ago
dd-file-issue
This skill helps file GitHub issues to the DataDog/pup repository for bugs, feature requests, and documentation problems related to the pup CLI, agents, and…
Claude Code, Codex, Cursor +3 · about 2.2K tokens · pinned 7 days ago
dd-idp
Queries Datadog's Unified Entity Graph to find and connect software services, teams, infrastructure, dependencies, and operational context through read-only…
Claude Code, Codex, Cursor +4 · about 1.8K tokens · pinned 7 days ago
agent-observability-auto-experiment
Runs a local hill-climb optimization loop to improve code or prompts against real Datadog LLM-Obs evaluation data.
Contains scripts
Claude Code · about 28.4K tokens · pinned 7 days ago
agent-observability-build-eval-from-annotations
Fits an LLM evaluator to human-labeled data by iteratively scoring a judge against the labels, reading its errors, making targeted improvements, and…
Contains scripts
Claude Code, Codex, Cursor +3 · about 12.1K tokens · pinned 7 days ago
agent-observability-eval-bootstrap
Generates evaluators from production LLM traces by analyzing patterns and quality dimensions.
Claude Code · about 24.5K tokens · pinned 7 days ago
Related in Observability
agent-observability-online-experiment
This skill guides users through setting up online A/B tests for LLM applications using Datadog's Agent Observability and feature flags.
by DatadogOfficial publisher
Claude Code, Codex, Cursor +4 · about 5.9K tokens · pinned 7 days ago
agent-observability-replay-trace
Replay a single production trace against local code changes to test fixes iteratively.
by DatadogOfficial publisher
Contains scripts
Claude Code · about 3.4K tokens · pinned 7 days ago
agent-observability-session-classify
Classifies whether a user's intent was satisfied in a Datadog Agent Observability trace or session by analyzing conversation content, tool outcomes, and…
by DatadogOfficial publisher
Claude Code, Codex, Cursor +4 · about 15.7K tokens · pinned 7 days ago
agent-skills
This skill package provides Datadog observability tools for AI agents, including monitoring, logging, tracing, APM, and cloud integrations through the pup CLI.
by DatadogOfficial publisher
Claude Code, Codex, Cursor +4 · about 910 tokens · pinned 7 days ago
dd-account-setup
Ensures a user has a valid Datadog API key and application key on the correct region before running any Datadog instrumentation.
by DatadogOfficial publisher
Claude Code, Codex, Cursor +4 · about 4.3K tokens · pinned 7 days ago
dd-apm
This skill enables agents to set up Datadog APM for distributed tracing and performance analysis.
by DatadogOfficial publisher
Claude Code · about 1.8K tokens · pinned 7 days ago