Agent Native

dd-logs

This skill enables searching logs in Datadog, configuring log processing pipelines, and managing log archives through command-line tools.

by DatadogOfficial publisherNot reviewed

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
MIT (permissive)
Pin
9cbd518pinned Oct 9, 2026
Context cost
about 1,100 tokenswhen the skill loads
GitHub stars
177on datadog-labs/agent-skills
Scripts
None found

What it does

“Log management - search, archives, metrics, and cost control.”
The author's description, from SKILL.md

Generated summary from the skill's own text

This skill enables searching logs in Datadog, configuring log processing pipelines, and managing log archives through command-line tools. It provides syntax for querying logs, setting up processors and exclusion filters to control costs, and storing logs in external storage for compliance.

When to use it

  • Investigating errors and performance issues in production logs
  • Reducing log ingestion costs by filtering or excluding noisy sources
  • Parsing unstructured logs with grok patterns and remapping attributes
  • Archiving logs to cloud storage for compliance and long-term retention

When not to

  • Rehydrating archived logs, as the tool lacks rehydration commands
  • Handling sensitive data without prior application-level sanitization
  • When log volumes are too large for efficient CLI-based discovery

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add datadog-labs/agent-skills --skill dd-logs

Installs 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-labs/agent-skills dd-logs@9cbd518922765c46d5d446f09cf03d060dd4b46f

Installs the commit we checked (9cbd518).

Copy by hand

Download the folder at 9cbd518 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.

Skill folder on GitHub at 9cbd518

Claude Code plugin

/plugin install datadog@claude-plugins-official

The 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 9cbd518922765c46d5d446f09cf03d060dd4b46f:
https://github.com/datadog-labs/agent-skills/tree/9cbd518922765c46d5d446f09cf03d060dd4b46f/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

SKILL.md at the pin

---
name: dd-logs
description: Log management - search, archives, metrics, and cost control.
metadata:
  version: "1.0.1"
  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 should already be installed. See [Setup Pup](https://github.com/datadog-labs/agent-skills/tree/main?tab=readme-ov-file#setup-pup) if not.

## Command Execution Order (Token-Efficient)

For scoped commands, use this order:

1. Check context first (prior outputs, conversation, saved values).
2. If a required value is missing, run a discovery command first.
3. If still ambiguous, ask the user to confirm.
4. Then run the target command.
5. Avoid speculative commands likely to fail.

## 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
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 |

## Configuration APIs

Available log configuration commands in pup 0.42.0:

```bash
# List log archives
pup logs archives list

# List log restriction queries
pup logs restriction-queries list

# List custom log destinations
pup logs custom-destinations list
```

### 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"]
}
```

### Rehydrate (Restore)

```bash
# No `pup logs rehydrate` command in pup 0.42.0.
# Use Datadog UI/API for rehydration workflows.
```

## Log-Based Metrics

Create metrics from logs (cheaper than indexing):

```bash
# List log-based metrics
pup logs metrics list

# Get one metric by ID
pup logs metrics get api.errors.count
```

**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 |

## 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-labs/agent-skills at 9cbd518, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 9cbd518

Files

1 file, 4.7 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 9cbd518
All 50 skills from Datadog

More 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 6 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 6 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 6 days ago

  • dd-logs

    This skill enables agents to search, process, and archive Datadog logs using the pup command-line tool.

    Claude Code, Codex, Cursor +4 · about 1.2K tokens · pinned 6 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 6 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 6 days ago

All Observability skills
  • 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 6 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 6 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 6 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 6 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 6 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 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use