AgentSkillsCN

cdn-log-analyzer

分析本地文件路径或 HTTP/HTTPS URL 中的 CDN 访问日志,即使日志格式未知亦可。适用于需要自动检测 CDN 日志格式(JSONL、CloudFront 风格字段、CSV/TSV/空格分隔、nginx/apache 访问日志)的场景,可对流量、错误、缓存及延迟进行汇总,并生成 Markdown 报告。

SKILL.md
--- frontmatter
name: cdn-log-analyzer
description: Analyze CDN access logs from a local file path or an HTTP/HTTPS URL, even when the log format is unknown. Use when you need to auto-detect CDN log formats (JSONL, CloudFront-style fields, CSV/TSV/space-delimited, nginx/apache access logs), summarize traffic/errors/cache/latency, and generate a markdown report.

CDN Log Analyzer

Quick use

Run the bundled analyzer script and then summarize the results.

Local file:

bash
node scripts/analyze-cdn-logs.js --file /path/to/cdn.log

URL (HTTPS-only v1):

bash
node scripts/analyze-cdn-logs.js --url "https://example.com/cdn.log"
node scripts/analyze-cdn-logs.js --url "https://example.com/cdn.log" --header "Authorization: Bearer XXX"

Workflow

  1. Ask for the input source: --file path or --url.
  2. Ask what they care about (errors, cache misses, top endpoints, latency).
  3. Run the script.
  4. Report:
    • detected format + confidence
    • parse success rate
    • time range
    • status distribution + top status codes
    • top hosts/paths/ips/user agents
    • bytes totals (if present)
    • cache hit/miss (if present)
    • latency percentiles (if present)

Notes

  • Format detection is best-effort and based on sampling.
  • The script is deterministic; it does not call an LLM.