scan-logs

Scan oversized logs with Gemini-backed grep and summarization modes.

3.2k|266|Updated Mar 22, 2024
One-click install
npx skills add https://github.com/marin-community/marin --skill scan-logs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scan-logs
Source: https://github.com/marin-community/marin/tree/main/.agents/skills/scan-logs
Command: npx skills add https://github.com/marin-community/marin --skill scan-logs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Oversized log files are too large to read manually or paste into a chat context, making it hard to locate errors or understand failures. This Skill runs a script that searches and summarizes large logs using the Gemini API.

Core Features & Use Cases

  • Natural-language grep: Find line-numbered original log lines matching a plain-language query.
  • Hierarchical summarization: Produce a Markdown report summarizing the log around a query, reducing large inputs in 50,000-token chunks.
  • Pipeline mode: Narrow a log with grep, then pipe results into summarize via --stdin for focused reports.
  • Use Case: A training run produces a multi-gigabyte log; run grep for "errors" and pipe the matches into summarize to get a concise Markdown diagnosis of what went wrong.

Quick Start

Ask the assistant to scan the large log file for error patterns and produce a summarized Markdown report using the scan-logs script.

Frequently Asked Questions about scan-logs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search a large log file with a natural language query?

Run the logscan script in grep mode with the log file path and your query, for example: uv run scripts/logscan.py grep log.txt "errors". It returns line-numbered original lines matching the query, with progress reported to stderr.

How do I summarize a huge log file that exceeds context limits?

Use summarize mode, which hierarchically reduces large inputs in 50,000-token chunks and outputs a Markdown report to stdout. You can also pipe grep results into summarize with --stdin to narrow the input first.

Does log scanning require an API key?

Yes, GEMINI_API_KEY must be set because the log content is sent to the external Gemini API. This incurs model usage costs, so avoid sending logs containing secrets or sensitive data without approval.

Can I adjust chunk size, concurrency, or the Gemini model?

Yes, use --chunk-tokens, --concurrency, and --model options. Defaults are 5,000-token grep chunks, 50,000-token summarize chunks, concurrency 16, and gemini-2.5-flash-lite; check --help before overriding.

When should I not use Gemini-backed log analysis?

Avoid it when logs contain secrets or sensitive data that cannot leave your environment, since content is sent to an external API. Also verify generated diagnoses against the matched source lines before acting on them.