log-search

Search stored Docker container logs for a text query using container-log-viewer. Covers clv search CLI and the /api/logs/search HTTP endpoint.

7 stars

Best use case

log-search is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Search stored Docker container logs for a text query using container-log-viewer. Covers clv search CLI and the /api/logs/search HTTP endpoint.

Teams using log-search should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/log-search/SKILL.md --create-dirs "https://raw.githubusercontent.com/heldernoid/agentic-build-templates/main/projects/developer-tools/container-log-viewer/skills/log-search/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/log-search/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How log-search Compares

Feature / Agentlog-searchStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Search stored Docker container logs for a text query using container-log-viewer. Covers clv search CLI and the /api/logs/search HTTP endpoint.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# log-search skill

Use this skill when the user wants to:
- Search log history for an error message or keyword
- Find which containers logged a specific string
- Filter search results by level or container
- Query the search API programmatically

## CLI search

```
clv search "<query>"
```

Searches all stored log lines using SQLite FTS5 full-text search.

Options:

```
--container <name>   Limit search to one container
--level <levels>     Filter by level: error,warn,info,debug
--limit <n>          Max results (default 50)
--format <text|json> Output format (default: text)
```

Examples:

```
# Find all "connection refused" occurrences
clv search "connection refused"

# Errors only in the worker container
clv search "timeout" --container worker --level error

# JSON output for scripting
clv search "ECONNREFUSED" --format json

# Raise the result cap
clv search "deprecated" --limit 200
```

## Output format

Text output columns: TIME, CONTAINER, LEVEL, MESSAGE

The query term is highlighted in the MESSAGE column (terminal: amber/bold; web UI: yellow background chip).

JSON output per result:

```json
{
  "id": 1794,
  "container_name": "worker",
  "ts": "2026-03-20T15:50:14.600Z",
  "level": "error",
  "stream": "stderr",
  "msg": "Job failed: SMTP connection refused",
  "raw": "{\"level\":\"error\",\"msg\":\"Job failed: SMTP connection refused\",...}"
}
```

## HTTP API

### Search endpoint

```
GET /api/logs/search?q=<query>[&container=<name>][&level=<levels>][&limit=<n>]
```

Response:

```json
{
  "query": "connection refused",
  "total": 8,
  "results": [
    {
      "id": 1201,
      "container_name": "worker",
      "ts": "2026-03-20T15:50:14.600Z",
      "level": "error",
      "stream": "stderr",
      "msg": "Job failed: SMTP connection refused",
      "raw": "..."
    }
  ]
}
```

### Other log endpoints

```
GET /api/logs?container=<name>[&level=<levels>][&since=<iso>][&limit=<n>]
```

Returns paginated log lines for a container. Use `since` with an ISO timestamp for pagination.

```
GET /api/logs/:id
```

Returns a single log line by ID with full raw field.

## CI / scripting example

Check for any ERROR logs in the last run before promoting:

```bash
ERRORS=$(clv search "ERROR" --container api --level error --format json | jq '.total')
if [ "$ERRORS" -gt 0 ]; then
  echo "Found $ERRORS errors in api container - aborting deploy"
  exit 1
fi
```

## Web UI search

Open http://127.0.0.1:3200, click "Search logs" in the sidebar.

- Type a query and press Enter or click Search
- Results show across all containers with highlighted match terms
- Use level chips to narrow results
- Click any result row to expand full JSON payload

## FTS notes

- Search is case-insensitive
- Phrase search: use quotes - "connection refused"
- Prefix search: append * - "connectio*"
- The FTS index covers the `msg` field only, not the raw JSON body
- Results are ordered by timestamp descending (most recent first)

Related Skills

full-text-search

7
from heldernoid/agentic-build-templates

SQLite FTS5 full-text search with prefix matching, ranked results, and highlighted snippets

Skill: Uptime Monitoring

7
from heldernoid/agentic-build-templates

## Overview

Skill: Status Page

7
from heldernoid/agentic-build-templates

## Overview

Skill: unit-conversion

7
from heldernoid/agentic-build-templates

## Overview

Skill: recipe-scaler

7
from heldernoid/agentic-build-templates

## Overview

reading-list

7
from heldernoid/agentic-build-templates

Operate the reading-list API to save, manage, tag, search, and export articles.

email-digest

7
from heldernoid/agentic-build-templates

Configure, test, and troubleshoot the reading-list daily email digest delivered via nodemailer.

websocket-realtime

7
from heldernoid/agentic-build-templates

Use the WebSocket connection in poll-builder to receive live vote updates. Use when you need to stream real-time poll results, monitor a poll for new votes, or build a live dashboard. Triggers include "live results", "real-time updates", "stream votes", "watch poll", or "WebSocket".

poll-builder

7
from heldernoid/agentic-build-templates

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.

Skill: personal-finance

7
from heldernoid/agentic-build-templates

## Overview

Skill: csv-import

7
from heldernoid/agentic-build-templates

## Overview

Skill: Syntax Highlighting

7
from heldernoid/agentic-build-templates

## Purpose