{"id":"fa582fa9-5c79-4248-b74a-3783437fd421","entityType":"agent","slug":"clawhub-gopendrasharma89-tech-clean-log-toolkit","name":"Clean Log Toolkit","canonicalUrl":"https://www.xpersona.co/agent/clawhub-gopendrasharma89-tech-clean-log-toolkit","canonicalPath":"/agent/clawhub-gopendrasharma89-tech-clean-log-toolkit","generatedAt":"2026-10-14T00:03:17.684Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-12T02:32:01.884Z","emptyReason":null},"description":"Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex wi... Skill: Clean Log Toolkit Owner: gopendrasharma89-tech Summary: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex wi... Tags: agent:0.2.0, apache:0.2.0, errors:0.2.0, follow:0.2.0, grep:0.2.0, json-line:0.1.0, latest:0.2.0, live:0.2.0, log:0.2.0, nginx:0.2.0, observability:0.2.0, parse:0.2.0, stdlib:0.2.0, syslog:0","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 954 downloads reported by the source. Last updated 10/12/2026.","installCommand":"clawhub skill install s17cp87fy279ggwne1mqcb6675843tdy:clean-log-toolkit","sourceUrl":"https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit","homepage":"https://clawhub.ai/gopendrasharma89-tech/skills/clean-log-toolkit","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/gopendrasharma89-tech/skills/clean-log-toolkit","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex wi..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:32:01.884Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:32:01.884Z","emptyReason":null},"stars":null,"forks":null,"downloads":954,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"0.2.0","tractionLabel":"954 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:32:01.871Z","emptyReason":null},"lastUpdatedAt":"2026-10-12T02:32:01.884Z","lastCrawledAt":"2026-10-12T02:32:01.871Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-13T02:32:01.871Z","lastVerifiedAt":null,"highlights":[{"version":"0.2.0","createdAt":"2026-06-04T17:57:15.710Z","changelog":"v0.2.0: Add scripts/follow.py - tail -F equivalent for live log monitoring, log-aware. Streams new lines as they arrive with the same --pattern / --not-pattern / --level / --since filters as grep.py. Automatic log-rotation detection (inode change or file truncation triggers transparent reopen). --max-events N exits cleanly after N matched events (CI-friendly), --timeout SECONDS exits on inactivity, --json emits per-line JSON envelopes with extracted timestamp + level. Closes the only documented limitation from v0.1.x ('It does not tail/follow live log files').","fileCount":10,"zipByteSize":20569},{"version":"0.1.1","createdAt":"2026-05-25T04:23:41.978Z","changelog":"v0.1.1 bug-fix release. Timestamp parser now accepts date-only values for grep.py --since / --until: 2026-05-09, 2026/05/09, 09/05/2026, and Y-m-d H:M (minute precision). Previously only full ISO 8601 timestamps worked, so users trying --since 2026-05-09 got a 'could not parse' error. No CLI changes.","fileCount":9,"zipByteSize":17331},{"version":"0.1.0","createdAt":"2026-05-21T07:16:56.963Z","changelog":"v0.1.0 initial release. Third skill in the 'clean-*' trio (after csv and text). Three scripts in pure stdlib: parse.py (auto-detects apache-common/apache-combined/nginx-access/syslog/json-line formats, custom --regex with named groups, fallback generic timestamp+level extractor), errors.py (aggregate by level + time-bucket minute/hour/day, fingerprint normalization for message grouping, output as JSON/Markdown/CSV report), grep.py (pattern + --not-pattern + --level + --since/--until time window + -B/-A/-C context lines). Shared timestamp parser handles ISO 8601 with/without TZ/microseconds, apache common log, syslog. Safe-path policy and 0/1/2 exit-code contract. Zero third-party dependencies.","fileCount":8,"zipByteSize":15948}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cp87fy279ggwne1mqcb6675843tdy:clean-log-toolkit","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-14T00:03:17.683Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gopendrasharma89-tech-clean-log-toolkit/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-12T02:32:01.884Z","emptyReason":null},"readme":"Skill: Clean Log Toolkit\n\nOwner: gopendrasharma89-tech\n\nSummary: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex wi...\n\nTags: agent:0.2.0, apache:0.2.0, errors:0.2.0, follow:0.2.0, grep:0.2.0, json-line:0.1.0, latest:0.2.0, live:0.2.0, log:0.2.0, nginx:0.2.0, observability:0.2.0, parse:0.2.0, stdlib:0.2.0, syslog:0.2.0, tail:0.2.0, timestamp:0.1.1\n\nVersion history:\n\nv0.2.0 | 2026-06-04T17:57:15.710Z | user\n\nv0.2.0: Add scripts/follow.py - tail -F equivalent for live log monitoring, log-aware. Streams new lines as they arrive with the same --pattern / --not-pattern / --level / --since filters as grep.py. Automatic log-rotation detection (inode change or file truncation triggers transparent reopen). --max-events N exits cleanly after N matched events (CI-friendly), --timeout SECONDS exits on inactivity, --json emits per-line JSON envelopes with extracted timestamp + level. Closes the only documented limitation from v0.1.x ('It does not tail/follow live log files').\n\nv0.1.1 | 2026-05-25T04:23:41.978Z | user\n\nv0.1.1 bug-fix release. Timestamp parser now accepts date-only values for grep.py --since / --until: 2026-05-09, 2026/05/09, 09/05/2026, and Y-m-d H:M (minute precision). Previously only full ISO 8601 timestamps worked, so users trying --since 2026-05-09 got a 'could not parse' error. No CLI changes.\n\nv0.1.0 | 2026-05-21T07:16:56.963Z | user\n\nv0.1.0 initial release. Third skill in the 'clean-*' trio (after csv and text). Three scripts in pure stdlib: parse.py (auto-detects apache-common/apache-combined/nginx-access/syslog/json-line formats, custom --regex with named groups, fallback generic timestamp+level extractor), errors.py (aggregate by level + time-bucket minute/hour/day, fingerprint normalization for message grouping, output as JSON/Markdown/CSV report), grep.py (pattern + --not-pattern + --level + --since/--until time window + -B/-A/-C context lines). Shared timestamp parser handles ISO 8601 with/without TZ/microseconds, apache common log, syslog. Safe-path policy and 0/1/2 exit-code contract. Zero third-party dependencies.\n\nArchive index:\n\nArchive v0.2.0: 10 files, 20569 bytes\n\nFiles: LICENSE (1078b), scripts/_common.py (3617b), scripts/check_deps.sh (304b), scripts/errors.py (9124b), scripts/follow.py (8524b), scripts/grep.py (7667b), scripts/parse.py (11246b), skill-card.md (2425b), SKILL.md (9996b), _meta.json (136b)\n\nFile v0.2.0:SKILL.md\n\n---\nname: clean-log-toolkit\ndescription: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex with named groups into structured TSV/CSV/JSONL. Aggregate errors by level and time bucket (minute/hour/day), surface the most common error groups via fingerprint normalization, and produce JSON/Markdown/CSV reports. Grep log lines with optional time-window (--since/--until), level filter, named-group regex, and -B/-A/-C context lines. Pure Python 3 standard library, no third-party dependencies, no remote calls.\nlicense: MIT\nmetadata: {\"openclaw\":{\"requires\":{\"bins\":[\"python3\"]},\"primaryEnv\":null,\"homepage\":\"https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit\"}}\n---\n\n# clean-log-toolkit\n\nv0.2.0\n\nA small, honest local toolkit for the work agents end up doing constantly: read a log someone sent you, figure out the format, find the actual problems, and produce a summary you can paste into a ticket. Built on Python 3 standard library only. No `awk`/`sed`/`jq` wrappers, no pip installs, no remote calls.\n\nThis skill is the third of the \"clean-*\" trio:\n- [`clean-csv-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) — structured tabular data\n- [`clean-text-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) — unstructured text\n- **`clean-log-toolkit`** — semi-structured timestamped logs\n\n## What this skill does\n\n- `scripts/parse.py` — parse a log file into structured rows. Auto-detects `apache-common`, `apache-combined`, `nginx-access`, `syslog`, and `json-line` formats by sniffing the first ~50 lines. Falls back to a generic timestamp + level + message extractor when nothing matches. Pass `--regex PATTERN` with named groups to define a custom format. Output as `.csv`, `.tsv`, or `.jsonl`.\n- `scripts/errors.py` — aggregate the errors in a log file. Counts by level (WARN / ERROR / FATAL by default), buckets the timeline by minute / hour / day, normalizes each message into a \"fingerprint\" (replaces numbers, UUIDs, hex tokens, file:line pairs, and embedded timestamps with placeholders) and surfaces the top-N most frequent error groups. Writes a JSON / Markdown / CSV report or prints a one-screen summary.\n- `scripts/grep.py` — grep, but log-aware. Combine `--pattern REGEX`, `--not-pattern REGEX`, `--level LVL[,LVL2...]`, `--since TIMESTAMP`, `--until TIMESTAMP`, and `-B / -A / -C` context lines into one filter pass.\n- `scripts/follow.py` (NEW in v0.2.0) — `tail -F` equivalent, log-aware. Streams new lines as they arrive with the same `--pattern` / `--not-pattern` / `--level` / `--since` filters as `grep.py`. Detects log rotation automatically (inode change or file truncation reopens the file). `--max-events N` exits cleanly after N matched events (CI-friendly); `--timeout SECONDS` exits on inactivity; `--json` emits per-line envelopes with extracted timestamp + level.\n- `scripts/check_deps.sh` — verify `python3` is available.\n\n## What this skill does not do\n\n- Live tail-and-follow is now supported via `scripts/follow.py` (added v0.2.0).\n- It does not call any LLM, web service, or remote API.\n- It does not write outside the input/output paths the caller provides.\n\n## Quick start\n\n### 1. Parse an unknown log file\n\n```bash\n# Auto-detect the format\npython3 scripts/parse.py app.log app.csv\n\n# Or be explicit\npython3 scripts/parse.py access.log out.jsonl --format apache-combined\npython3 scripts/parse.py syslog.txt out.csv --format syslog\npython3 scripts/parse.py events.log out.csv --format json-line --fields ts,level,msg\n```\n\n### 2. Custom format via named-group regex\n\n```bash\npython3 scripts/parse.py app.log structured.csv \\\n    --regex '^(?P<ts>\\S+)\\s+(?P<level>\\S+)\\s+(?P<message>.*)$'\n```\n\n### 3. Aggregate errors and produce a report\n\n```bash\n# One-screen summary\npython3 scripts/errors.py app.log\n\n# Bucket by minute, top 20 message groups\npython3 scripts/errors.py app.log --bucket minute --top 20\n\n# Only count specific levels\npython3 scripts/errors.py app.log --level ERROR,FATAL\n\n# Write a Markdown report ready to paste into a ticket\npython3 scripts/errors.py app.log --output report.md\n\n# Or a JSON report for downstream tooling\npython3 scripts/errors.py app.log --output report.json --bucket hour\n\n# Or a CSV of the timeline only\npython3 scripts/errors.py app.log --output timeline.csv --bucket minute\n```\n\n`errors.py` fingerprints messages so repeated errors that only differ in numbers / UUIDs / file-line refs collapse to one group with a count. Example: 50 occurrences of `Connection timeout to 10.0.0.5 after 1234ms` and `Connection timeout to 10.0.0.7 after 567ms` collapse into one group `Connection timeout to <N>.<N>.<N>.<N> after <N>ms` with count 50.\n\n### 4. Log-aware grep\n\n```bash\n# Pattern + level filter\npython3 scripts/grep.py app.log --pattern \"Database\" --level ERROR,FATAL\n\n# Time window\npython3 scripts/grep.py app.log \\\n    --since \"2026-05-10T10:00:00Z\" \\\n    --until \"2026-05-10T11:00:00Z\"\n\n# Context lines (1 before + 1 after each match)\npython3 scripts/grep.py app.log --pattern \"FATAL\" -C 1 --with-line\n\n# Exclude noisy lines while keeping the rest\npython3 scripts/grep.py app.log --level ERROR --not-pattern \"heartbeat\"\n\n# Invert: keep everything that does NOT match\npython3 scripts/grep.py app.log --pattern \"INFO\" --invert\n```\n\n`--since` and `--until` accept the same timestamp formats `parse.py` understands: ISO 8601 (`2026-05-10T10:00:00Z`, `2026-05-10 10:00:00`, with or without microseconds / timezone), apache-style (`10/May/2026:10:00:00 +0000`), and syslog (`May 10 10:00:00` — current year assumed).\n\n## Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | success / one or more rows / one or more matches |\n| 1 | parse produced zero rows / grep found zero matches / errors found zero matching log entries |\n| 2 | bad arguments / unsafe path / missing input / bad regex / unknown format / unsupported output extension |\n\nThis 0 / 1 / 2 split is consistent across all three scripts so they slot into shell pipelines cleanly:\n\n```bash\n# Parse to JSONL, then summarize errors, then post to a ticket\npython3 scripts/parse.py raw.log structured.jsonl \\\n  && python3 scripts/errors.py raw.log --output ticket.md \\\n  && cat ticket.md\n```\n\n## Safety properties\n\n- Pure Python 3 standard library. No third-party dependencies.\n- No `subprocess` calls. No shell invocation.\n- All file paths are validated against a strict allowlist regex that rejects shell metacharacters. The same `safe_path()` helper used in `clean-csv-toolkit` and `clean-text-toolkit`.\n- Scripts only read the input paths the caller provides and write to the output paths the caller provides.\n- All inputs default to UTF-8; reads fall back through `utf-8-sig`, `cp1252`, `latin-1` if needed. Writes are always UTF-8.\n\n## Timestamp + level detection\n\n`_common.py` ships a pragmatic timestamp parser that tries the following formats in order, picking the first that matches:\n\n```\n2026-05-10T10:00:00.123456+00:00     (ISO 8601 with TZ + microseconds)\n2026-05-10T10:00:00+00:00            (ISO 8601 with TZ)\n2026-05-10T10:00:00.123Z              (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00Z                  (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00                   (ISO 8601 no TZ)\n2026-05-10 10:00:00                   (space-separated)\n2026/05/10 10:00:00\n10/May/2026:10:00:00 +0000           (apache common log)\nMay 10 10:00:00                       (syslog, no year)\n```\n\nLevels are detected case-insensitively from these tokens and folded to canonical names: `TRACE`, `DEBUG`, `INFO`, `NOTICE`, `WARN` (from WARN/WARNING), `ERROR` (from ERROR/ERR), `FATAL` (from FATAL/CRITICAL/CRIT/EMERG/EMERGENCY).\n\n## Known limitations\n\n- The regex-based parsers are pragmatic, not strict — they accept slightly malformed Apache / nginx / syslog lines as long as the structure is close enough.\n- `errors.py` fingerprint normalization is a best-effort heuristic. Two semantically different errors that happen to differ only in numbers / hashes will be collapsed; if that matters, use `--top` with a larger N and inspect the samples.\n- `parse.py` does not follow a live log file. For tail-follow, pipe `tail -F file | ...` into your own tool. If there's enough demand for a built-in follower, it will land in v0.2.\n\n## Pairs well with\n\n- [`clean-csv-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) — pipe `parse.py` output (CSV / JSONL) into `inspect`, `validate`, `pivot`, or `transform` to turn raw logs into reportable tables.\n- [`clean-text-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) — pair `parse.py` with `text-toolkit/redact.py` to scrub PII before sharing log dumps.\n\n## v0.2.0 changes\n\n- Added `scripts/follow.py`: live tail-and-follow with log-aware filtering. Same `--pattern` / `--not-pattern` / `--level` / `--since` filters as `grep.py`. Automatic log-rotation detection (inode change or truncation triggers a transparent reopen). `--max-events N` and `--timeout SECONDS` make it CI-friendly; `--json` emits one envelope per matched line with extracted timestamp + level. Closes the only documented limitation from v0.1.x.\n\n## v0.1.1 changes\n\n- Fixed timestamp parser: `--since` and `--until` on `grep.py` now accept date-only values like `2026-05-09`, `2026/05/09`, and `09/05/2026` (European). Previously only full ISO 8601 timestamps were accepted, so users trying to filter by a calendar date got a `could not parse --since` error.\n\n## v0.1.0 changes\n\n- First public release of clean-log-toolkit.\n- Three scripts: `parse.py`, `errors.py`, `grep.py`.\n- Shared `_common.py` with `safe_path`, `iter_lines`, `parse_timestamp`, `extract_timestamp`, `extract_level` helpers (mirrors the design of `clean-csv-toolkit/scripts/_common.py` and `clean-text-toolkit/scripts/_common.py`).\n- Auto-detects 5 log formats by sniffing the first 50 lines.\n- Zero third-party dependencies; works on any system that ships Python 3.\n\n## License\n\nMIT\n\nFile v0.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn7fkwsa5knkdkkachj1p7rwr9843xts\",\n  \"slug\": \"clean-log-toolkit\",\n  \"version\": \"0.2.0\",\n  \"publishedAt\": 1780595835710\n}\n\nFile v0.2.0:skill-card.md\n\n## Description:\n\nClean Log Toolkit helps agents inspect local log files by parsing common formats, aggregating errors, filtering by pattern, time, level, and context, following live logs, and producing structured reports without third-party dependencies or remote calls.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[gopendrasharma89-tech](https://clawhub.ai/user/gopendrasharma89-tech)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers, support engineers, and agents use this skill to inspect local log files, convert logs into structured outputs, find error clusters, filter incident windows by time, level, and pattern, and prepare reports for tickets or downstream analysis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Output files can overwrite source logs or symlink aliases, which can cause data loss.\n\nMitigation: Use a separate output directory and confirm output paths are not the original log path or a symlink to it before running parse, grep, or error-report commands.\n\nRisk: Generated reports can preserve sensitive raw log content.\n\nMitigation: Inspect and redact reports before sharing them in tickets, repositories, spreadsheets, or chat.\n\n## Reference(s):\n\n- [Clean Log Toolkit ClawHub skill page](https://clawhub.ai/gopendrasharma89-tech/skills/clean-log-toolkit)\n- [Clean Log Toolkit ClawHub homepage](https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit)\n- [Related Clean CSV Toolkit](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit)\n- [Related Clean Text Toolkit](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, CSV, TSV, JSONL, shell commands, guidance]\n\n**Output Format:** [Plain text summaries, filtered log lines, Markdown reports, JSON reports, CSV/TSV tables, JSONL rows, and shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces local stdout output or files at caller-provided paths; follow.py can stream matched lines as JSON envelopes.]\n\n## Skill Version(s):\n\n0.2.0 (source: release metadata and SKILL.md body)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.2.0:LICENSE\n\nMIT License\n\nCopyright (c) 2026 gopendrasharma89-tech\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v0.1.1: 9 files, 17331 bytes\n\nFiles: LICENSE (1078b), scripts/_common.py (3617b), scripts/check_deps.sh (304b), scripts/errors.py (9124b), scripts/grep.py (7667b), scripts/parse.py (11246b), skill-card.md (2285b), SKILL.md (9176b), _meta.json (136b)\n\nFile v0.1.1:SKILL.md\n\n---\nname: clean-log-toolkit\ndescription: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex with named groups into structured TSV/CSV/JSONL. Aggregate errors by level and time bucket (minute/hour/day), surface the most common error groups via fingerprint normalization, and produce JSON/Markdown/CSV reports. Grep log lines with optional time-window (--since/--until), level filter, named-group regex, and -B/-A/-C context lines. Pure Python 3 standard library, no third-party dependencies, no remote calls.\nlicense: MIT\nmetadata: {\"openclaw\":{\"requires\":{\"bins\":[\"python3\"]},\"primaryEnv\":null,\"homepage\":\"https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit\"}}\n---\n\n# clean-log-toolkit\n\nv0.1.1\n\nA small, honest local toolkit for the work agents end up doing constantly: read a log someone sent you, figure out the format, find the actual problems, and produce a summary you can paste into a ticket. Built on Python 3 standard library only. No `awk`/`sed`/`jq` wrappers, no pip installs, no remote calls.\n\nThis skill is the third of the \"clean-*\" trio:\n- [`clean-csv-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) — structured tabular data\n- [`clean-text-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) — unstructured text\n- **`clean-log-toolkit`** — semi-structured timestamped logs\n\n## What this skill does\n\n- `scripts/parse.py` — parse a log file into structured rows. Auto-detects `apache-common`, `apache-combined`, `nginx-access`, `syslog`, and `json-line` formats by sniffing the first ~50 lines. Falls back to a generic timestamp + level + message extractor when nothing matches. Pass `--regex PATTERN` with named groups to define a custom format. Output as `.csv`, `.tsv`, or `.jsonl`.\n- `scripts/errors.py` — aggregate the errors in a log file. Counts by level (WARN / ERROR / FATAL by default), buckets the timeline by minute / hour / day, normalizes each message into a \"fingerprint\" (replaces numbers, UUIDs, hex tokens, file:line pairs, and embedded timestamps with placeholders) and surfaces the top-N most frequent error groups. Writes a JSON / Markdown / CSV report or prints a one-screen summary.\n- `scripts/grep.py` — grep, but log-aware. Combine `--pattern REGEX`, `--not-pattern REGEX`, `--level LVL[,LVL2...]`, `--since TIMESTAMP`, `--until TIMESTAMP`, and `-B / -A / -C` context lines into one filter pass. Output goes to stdout or to a file. Returns exit 0 on at least one match, 1 on zero matches.\n- `scripts/check_deps.sh` — verify `python3` is available.\n\n## What this skill does not do\n\n- It does not tail/follow live log files (yet — possible v0.2 feature if there's demand).\n- It does not call any LLM, web service, or remote API.\n- It does not write outside the input/output paths the caller provides.\n\n## Quick start\n\n### 1. Parse an unknown log file\n\n```bash\n# Auto-detect the format\npython3 scripts/parse.py app.log app.csv\n\n# Or be explicit\npython3 scripts/parse.py access.log out.jsonl --format apache-combined\npython3 scripts/parse.py syslog.txt out.csv --format syslog\npython3 scripts/parse.py events.log out.csv --format json-line --fields ts,level,msg\n```\n\n### 2. Custom format via named-group regex\n\n```bash\npython3 scripts/parse.py app.log structured.csv \\\n    --regex '^(?P<ts>\\S+)\\s+(?P<level>\\S+)\\s+(?P<message>.*)$'\n```\n\n### 3. Aggregate errors and produce a report\n\n```bash\n# One-screen summary\npython3 scripts/errors.py app.log\n\n# Bucket by minute, top 20 message groups\npython3 scripts/errors.py app.log --bucket minute --top 20\n\n# Only count specific levels\npython3 scripts/errors.py app.log --level ERROR,FATAL\n\n# Write a Markdown report ready to paste into a ticket\npython3 scripts/errors.py app.log --output report.md\n\n# Or a JSON report for downstream tooling\npython3 scripts/errors.py app.log --output report.json --bucket hour\n\n# Or a CSV of the timeline only\npython3 scripts/errors.py app.log --output timeline.csv --bucket minute\n```\n\n`errors.py` fingerprints messages so repeated errors that only differ in numbers / UUIDs / file-line refs collapse to one group with a count. Example: 50 occurrences of `Connection timeout to 10.0.0.5 after 1234ms` and `Connection timeout to 10.0.0.7 after 567ms` collapse into one group `Connection timeout to <N>.<N>.<N>.<N> after <N>ms` with count 50.\n\n### 4. Log-aware grep\n\n```bash\n# Pattern + level filter\npython3 scripts/grep.py app.log --pattern \"Database\" --level ERROR,FATAL\n\n# Time window\npython3 scripts/grep.py app.log \\\n    --since \"2026-05-10T10:00:00Z\" \\\n    --until \"2026-05-10T11:00:00Z\"\n\n# Context lines (1 before + 1 after each match)\npython3 scripts/grep.py app.log --pattern \"FATAL\" -C 1 --with-line\n\n# Exclude noisy lines while keeping the rest\npython3 scripts/grep.py app.log --level ERROR --not-pattern \"heartbeat\"\n\n# Invert: keep everything that does NOT match\npython3 scripts/grep.py app.log --pattern \"INFO\" --invert\n```\n\n`--since` and `--until` accept the same timestamp formats `parse.py` understands: ISO 8601 (`2026-05-10T10:00:00Z`, `2026-05-10 10:00:00`, with or without microseconds / timezone), apache-style (`10/May/2026:10:00:00 +0000`), and syslog (`May 10 10:00:00` — current year assumed).\n\n## Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | success / one or more rows / one or more matches |\n| 1 | parse produced zero rows / grep found zero matches / errors found zero matching log entries |\n| 2 | bad arguments / unsafe path / missing input / bad regex / unknown format / unsupported output extension |\n\nThis 0 / 1 / 2 split is consistent across all three scripts so they slot into shell pipelines cleanly:\n\n```bash\n# Parse to JSONL, then summarize errors, then post to a ticket\npython3 scripts/parse.py raw.log structured.jsonl \\\n  && python3 scripts/errors.py raw.log --output ticket.md \\\n  && cat ticket.md\n```\n\n## Safety properties\n\n- Pure Python 3 standard library. No third-party dependencies.\n- No `subprocess` calls. No shell invocation.\n- All file paths are validated against a strict allowlist regex that rejects shell metacharacters. The same `safe_path()` helper used in `clean-csv-toolkit` and `clean-text-toolkit`.\n- Scripts only read the input paths the caller provides and write to the output paths the caller provides.\n- All inputs default to UTF-8; reads fall back through `utf-8-sig`, `cp1252`, `latin-1` if needed. Writes are always UTF-8.\n\n## Timestamp + level detection\n\n`_common.py` ships a pragmatic timestamp parser that tries the following formats in order, picking the first that matches:\n\n```\n2026-05-10T10:00:00.123456+00:00     (ISO 8601 with TZ + microseconds)\n2026-05-10T10:00:00+00:00            (ISO 8601 with TZ)\n2026-05-10T10:00:00.123Z              (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00Z                  (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00                   (ISO 8601 no TZ)\n2026-05-10 10:00:00                   (space-separated)\n2026/05/10 10:00:00\n10/May/2026:10:00:00 +0000           (apache common log)\nMay 10 10:00:00                       (syslog, no year)\n```\n\nLevels are detected case-insensitively from these tokens and folded to canonical names: `TRACE`, `DEBUG`, `INFO`, `NOTICE`, `WARN` (from WARN/WARNING), `ERROR` (from ERROR/ERR), `FATAL` (from FATAL/CRITICAL/CRIT/EMERG/EMERGENCY).\n\n## Known limitations\n\n- The regex-based parsers are pragmatic, not strict — they accept slightly malformed Apache / nginx / syslog lines as long as the structure is close enough.\n- `errors.py` fingerprint normalization is a best-effort heuristic. Two semantically different errors that happen to differ only in numbers / hashes will be collapsed; if that matters, use `--top` with a larger N and inspect the samples.\n- `parse.py` does not follow a live log file. For tail-follow, pipe `tail -F file | ...` into your own tool. If there's enough demand for a built-in follower, it will land in v0.2.\n\n## Pairs well with\n\n- [`clean-csv-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) — pipe `parse.py` output (CSV / JSONL) into `inspect`, `validate`, `pivot`, or `transform` to turn raw logs into reportable tables.\n- [`clean-text-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) — pair `parse.py` with `text-toolkit/redact.py` to scrub PII before sharing log dumps.\n\n## v0.1.1 changes\n\n- Fixed timestamp parser: `--since` and `--until` on `grep.py` now accept date-only values like `2026-05-09`, `2026/05/09`, and `09/05/2026` (European). Previously only full ISO 8601 timestamps were accepted, so users trying to filter by a calendar date got a `could not parse --since` error.\n\n## v0.1.0 changes\n\n- First public release of clean-log-toolkit.\n- Three scripts: `parse.py`, `errors.py`, `grep.py`.\n- Shared `_common.py` with `safe_path`, `iter_lines`, `parse_timestamp`, `extract_timestamp`, `extract_level` helpers (mirrors the design of `clean-csv-toolkit/scripts/_common.py` and `clean-text-toolkit/scripts/_common.py`).\n- Auto-detects 5 log formats by sniffing the first 50 lines.\n- Zero third-party dependencies; works on any system that ships Python 3.\n\n## License\n\nMIT\n\nFile v0.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn7fkwsa5knkdkkachj1p7rwr9843xts\",\n  \"slug\": \"clean-log-toolkit\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1779683021978\n}\n\nFile v0.1.1:skill-card.md\n\n## Description: <br>\nClean Log Toolkit helps agents parse local log files, aggregate errors, filter lines by pattern, level, and time window, and generate JSON, Markdown, CSV, TSV, or JSONL reports without third-party dependencies or remote calls. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[gopendrasharma89-tech](https://clawhub.ai/user/gopendrasharma89-tech) <br>\n\n### License/Terms of Use: <br>\nMIT <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to inspect local log files, parse common or custom formats, filter log lines by pattern, level, and time window, and generate summaries or reports for troubleshooting workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Generated reports may include raw log lines or derived details that contain sensitive operational or personal data. <br>\nMitigation: Review and redact reports before sharing them outside the authorized audience. <br>\nRisk: The toolkit reads local log files and can write output files at caller-provided paths. <br>\nMitigation: Run it only on logs you are allowed to inspect and choose output paths intentionally. <br>\n\n\n## Reference(s): <br>\n- [Clean Log Toolkit on ClawHub](https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit) <br>\n- [Clean CSV Toolkit](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) <br>\n- [Clean Text Toolkit](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration] <br>\n**Output Format:** [Markdown guidance with shell commands; generated agent workflows may produce CSV, TSV, JSONL, JSON, Markdown, or plain-text reports.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Uses local Python 3 scripts and reads or writes only caller-provided paths.] <br>\n\n## Skill Version(s): <br>\n0.1.1 (source: server release metadata and SKILL.md) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.1.1:LICENSE\n\nMIT License\n\nCopyright (c) 2026 gopendrasharma89-tech\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v0.1.0: 8 files, 15948 bytes\n\nFiles: LICENSE (1078b), scripts/_common.py (3328b), scripts/check_deps.sh (304b), scripts/errors.py (9124b), scripts/grep.py (7667b), scripts/parse.py (11246b), SKILL.md (8863b), _meta.json (136b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: clean-log-toolkit\ndescription: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex with named groups into structured TSV/CSV/JSONL. Aggregate errors by level and time bucket (minute/hour/day), surface the most common error groups via fingerprint normalization, and produce JSON/Markdown/CSV reports. Grep log lines with optional time-window (--since/--until), level filter, named-group regex, and -B/-A/-C context lines. Pure Python 3 standard library, no third-party dependencies, no remote calls.\nlicense: MIT\nmetadata: {\"openclaw\":{\"requires\":{\"bins\":[\"python3\"]},\"primaryEnv\":null,\"homepage\":\"https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit\"}}\n---\n\n# clean-log-toolkit\n\nv0.1.0\n\nA small, honest local toolkit for the work agents end up doing constantly: read a log someone sent you, figure out the format, find the actual problems, and produce a summary you can paste into a ticket. Built on Python 3 standard library only. No `awk`/`sed`/`jq` wrappers, no pip installs, no remote calls.\n\nThis skill is the third of the \"clean-*\" trio:\n- [`clean-csv-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) — structured tabular data\n- [`clean-text-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) — unstructured text\n- **`clean-log-toolkit`** — semi-structured timestamped logs\n\n## What this skill does\n\n- `scripts/parse.py` — parse a log file into structured rows. Auto-detects `apache-common`, `apache-combined`, `nginx-access`, `syslog`, and `json-line` formats by sniffing the first ~50 lines. Falls back to a generic timestamp + level + message extractor when nothing matches. Pass `--regex PATTERN` with named groups to define a custom format. Output as `.csv`, `.tsv`, or `.jsonl`.\n- `scripts/errors.py` — aggregate the errors in a log file. Counts by level (WARN / ERROR / FATAL by default), buckets the timeline by minute / hour / day, normalizes each message into a \"fingerprint\" (replaces numbers, UUIDs, hex tokens, file:line pairs, and embedded timestamps with placeholders) and surfaces the top-N most frequent error groups. Writes a JSON / Markdown / CSV report or prints a one-screen summary.\n- `scripts/grep.py` — grep, but log-aware. Combine `--pattern REGEX`, `--not-pattern REGEX`, `--level LVL[,LVL2...]`, `--since TIMESTAMP`, `--until TIMESTAMP`, and `-B / -A / -C` context lines into one filter pass. Output goes to stdout or to a file. Returns exit 0 on at least one match, 1 on zero matches.\n- `scripts/check_deps.sh` — verify `python3` is available.\n\n## What this skill does not do\n\n- It does not tail/follow live log files (yet — possible v0.2 feature if there's demand).\n- It does not call any LLM, web service, or remote API.\n- It does not write outside the input/output paths the caller provides.\n\n## Quick start\n\n### 1. Parse an unknown log file\n\n```bash\n# Auto-detect the format\npython3 scripts/parse.py app.log app.csv\n\n# Or be explicit\npython3 scripts/parse.py access.log out.jsonl --format apache-combined\npython3 scripts/parse.py syslog.txt out.csv --format syslog\npython3 scripts/parse.py events.log out.csv --format json-line --fields ts,level,msg\n```\n\n### 2. Custom format via named-group regex\n\n```bash\npython3 scripts/parse.py app.log structured.csv \\\n    --regex '^(?P<ts>\\S+)\\s+(?P<level>\\S+)\\s+(?P<message>.*)$'\n```\n\n### 3. Aggregate errors and produce a report\n\n```bash\n# One-screen summary\npython3 scripts/errors.py app.log\n\n# Bucket by minute, top 20 message groups\npython3 scripts/errors.py app.log --bucket minute --top 20\n\n# Only count specific levels\npython3 scripts/errors.py app.log --level ERROR,FATAL\n\n# Write a Markdown report ready to paste into a ticket\npython3 scripts/errors.py app.log --output report.md\n\n# Or a JSON report for downstream tooling\npython3 scripts/errors.py app.log --output report.json --bucket hour\n\n# Or a CSV of the timeline only\npython3 scripts/errors.py app.log --output timeline.csv --bucket minute\n```\n\n`errors.py` fingerprints messages so repeated errors that only differ in numbers / UUIDs / file-line refs collapse to one group with a count. Example: 50 occurrences of `Connection timeout to 10.0.0.5 after 1234ms` and `Connection timeout to 10.0.0.7 after 567ms` collapse into one group `Connection timeout to <N>.<N>.<N>.<N> after <N>ms` with count 50.\n\n### 4. Log-aware grep\n\n```bash\n# Pattern + level filter\npython3 scripts/grep.py app.log --pattern \"Database\" --level ERROR,FATAL\n\n# Time window\npython3 scripts/grep.py app.log \\\n    --since \"2026-05-10T10:00:00Z\" \\\n    --until \"2026-05-10T11:00:00Z\"\n\n# Context lines (1 before + 1 after each match)\npython3 scripts/grep.py app.log --pattern \"FATAL\" -C 1 --with-line\n\n# Exclude noisy lines while keeping the rest\npython3 scripts/grep.py app.log --level ERROR --not-pattern \"heartbeat\"\n\n# Invert: keep everything that does NOT match\npython3 scripts/grep.py app.log --pattern \"INFO\" --invert\n```\n\n`--since` and `--until` accept the same timestamp formats `parse.py` understands: ISO 8601 (`2026-05-10T10:00:00Z`, `2026-05-10 10:00:00`, with or without microseconds / timezone), apache-style (`10/May/2026:10:00:00 +0000`), and syslog (`May 10 10:00:00` — current year assumed).\n\n## Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | success / one or more rows / one or more matches |\n| 1 | parse produced zero rows / grep found zero matches / errors found zero matching log entries |\n| 2 | bad arguments / unsafe path / missing input / bad regex / unknown format / unsupported output extension |\n\nThis 0 / 1 / 2 split is consistent across all three scripts so they slot into shell pipelines cleanly:\n\n```bash\n# Parse to JSONL, then summarize errors, then post to a ticket\npython3 scripts/parse.py raw.log structured.jsonl \\\n  && python3 scripts/errors.py raw.log --output ticket.md \\\n  && cat ticket.md\n```\n\n## Safety properties\n\n- Pure Python 3 standard library. No third-party dependencies.\n- No `subprocess` calls. No shell invocation.\n- All file paths are validated against a strict allowlist regex that rejects shell metacharacters. The same `safe_path()` helper used in `clean-csv-toolkit` and `clean-text-toolkit`.\n- Scripts only read the input paths the caller provides and write to the output paths the caller provides.\n- All inputs default to UTF-8; reads fall back through `utf-8-sig`, `cp1252`, `latin-1` if needed. Writes are always UTF-8.\n\n## Timestamp + level detection\n\n`_common.py` ships a pragmatic timestamp parser that tries the following formats in order, picking the first that matches:\n\n```\n2026-05-10T10:00:00.123456+00:00     (ISO 8601 with TZ + microseconds)\n2026-05-10T10:00:00+00:00            (ISO 8601 with TZ)\n2026-05-10T10:00:00.123Z              (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00Z                  (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00                   (ISO 8601 no TZ)\n2026-05-10 10:00:00                   (space-separated)\n2026/05/10 10:00:00\n10/May/2026:10:00:00 +0000           (apache common log)\nMay 10 10:00:00                       (syslog, no year)\n```\n\nLevels are detected case-insensitively from these tokens and folded to canonical names: `TRACE`, `DEBUG`, `INFO`, `NOTICE`, `WARN` (from WARN/WARNING), `ERROR` (from ERROR/ERR), `FATAL` (from FATAL/CRITICAL/CRIT/EMERG/EMERGENCY).\n\n## Known limitations\n\n- The regex-based parsers are pragmatic, not strict — they accept slightly malformed Apache / nginx / syslog lines as long as the structure is close enough.\n- `errors.py` fingerprint normalization is a best-effort heuristic. Two semantically different errors that happen to differ only in numbers / hashes will be collapsed; if that matters, use `--top` with a larger N and inspect the samples.\n- `parse.py` does not follow a live log file. For tail-follow, pipe `tail -F file | ...` into your own tool. If there's enough demand for a built-in follower, it will land in v0.2.\n\n## Pairs well with\n\n- [`clean-csv-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) — pipe `parse.py` output (CSV / JSONL) into `inspect`, `validate`, `pivot`, or `transform` to turn raw logs into reportable tables.\n- [`clean-text-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) — pair `parse.py` with `text-toolkit/redact.py` to scrub PII before sharing log dumps.\n\n## v0.1.0 changes\n\n- First public release of clean-log-toolkit.\n- Three scripts: `parse.py`, `errors.py`, `grep.py`.\n- Shared `_common.py` with `safe_path`, `iter_lines`, `parse_timestamp`, `extract_timestamp`, `extract_level` helpers (mirrors the design of `clean-csv-toolkit/scripts/_common.py` and `clean-text-toolkit/scripts/_common.py`).\n- Auto-detects 5 log formats by sniffing the first 50 lines.\n- Zero third-party dependencies; works on any system that ships Python 3.\n\n## License\n\nMIT\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7fkwsa5knkdkkachj1p7rwr9843xts\",\n  \"slug\": \"clean-log-toolkit\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1779347816963\n}\n\nFile v0.1.0:LICENSE\n\nMIT License\n\nCopyright (c) 2026 gopendrasharma89-tech\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","readmeExcerpt":"Skill: Clean Log Toolkit Owner: gopendrasharma89-tech Summary: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex wi... Tags: agent:0.2.0, apache:0.2.0, errors:0.2.0, follow:0.2.0, grep:0.2.0, json-line:0.1.0, latest:0.2.0, live:0.2.0, log:0.2.0, nginx:0.2.0, observability:0.2.0, parse:0.2.0, stdlib:0.2.0, syslog:0","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# Auto-detect the format\npython3 scripts/parse.py app.log app.csv\n\n# Or be explicit\npython3 scripts/parse.py access.log out.jsonl --format apache-combined\npython3 scripts/parse.py syslog.txt out.csv --format syslog\npython3 scripts/parse.py events.log out.csv --format json-line --fields ts,level,msg"},{"language":"bash","snippet":"python3 scripts/parse.py app.log structured.csv \\\n    --regex '^(?P<ts>\\S+)\\s+(?P<level>\\S+)\\s+(?P<message>.*)$'"},{"language":"bash","snippet":"# One-screen summary\npython3 scripts/errors.py app.log\n\n# Bucket by minute, top 20 message groups\npython3 scripts/errors.py app.log --bucket minute --top 20\n\n# Only count specific levels\npython3 scripts/errors.py app.log --level ERROR,FATAL\n\n# Write a Markdown report ready to paste into a ticket\npython3 scripts/errors.py app.log --output report.md\n\n# Or a JSON report for downstream tooling\npython3 scripts/errors.py app.log --output report.json --bucket hour\n\n# Or a CSV of the timeline only\npython3 scripts/errors.py app.log --output timeline.csv --bucket minute"},{"language":"bash","snippet":"# Pattern + level filter\npython3 scripts/grep.py app.log --pattern \"Database\" --level ERROR,FATAL\n\n# Time window\npython3 scripts/grep.py app.log \\\n    --since \"2026-05-10T10:00:00Z\" \\\n    --until \"2026-05-10T11:00:00Z\"\n\n# Context lines (1 before + 1 after each match)\npython3 scripts/grep.py app.log --pattern \"FATAL\" -C 1 --with-line\n\n# Exclude noisy lines while keeping the rest\npython3 scripts/grep.py app.log --level ERROR --not-pattern \"heartbeat\"\n\n# Invert: keep everything that does NOT match\npython3 scripts/grep.py app.log --pattern \"INFO\" --invert"},{"language":"bash","snippet":"# Parse to JSONL, then summarize errors, then post to a ticket\npython3 scripts/parse.py raw.log structured.jsonl \\\n  && python3 scripts/errors.py raw.log --output ticket.md \\\n  && cat ticket.md"},{"language":"text","snippet":"2026-05-10T10:00:00.123456+00:00     (ISO 8601 with TZ + microseconds)\n2026-05-10T10:00:00+00:00            (ISO 8601 with TZ)\n2026-05-10T10:00:00.123Z              (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00Z                  (ISO 8601 UTC Zulu)\n2026-05-10T10:00:00                   (ISO 8601 no TZ)\n2026-05-10 10:00:00                   (space-separated)\n2026/05/10 10:00:00\n10/May/2026:10:00:00 +0000           (apache common log)\nMay 10 10:00:00                       (syslog, no year)"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: clean-log-toolkit\ndescription: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex with named groups into structured TSV/CSV/JSONL. Aggregate errors by level and time bucket (minute/hour/day), surface the most common error groups via fingerprint normalization, and produce JSON/Markdown/CSV reports. Grep log lines with optional time-window (--since/--until), level filter, named-group regex, and -B/-A/-C context lines. Pure Python 3 standard library, no third-party dependencies, no remote calls.\nlicense: MIT\nmetadata: {\"openclaw\":{\"requires\":{\"bins\":[\"python3\"]},\"primaryEnv\":null,\"homepage\":\"https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit\"}}\n---\n\n# clean-log-toolkit\n\nv0.2.0\n\nA small, honest local toolkit for the work agents end up doing constantly: read a log someone sent you, figure out the format, find the actual problems, and produce a summary you can paste into a ticket. Built on Python 3 standard library only. No `awk`/`sed`/`jq` wrappers, no pip installs, no remote calls.\n\nThis skill is the third of the \"clean-*\" trio:\n- [`clean-csv-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit) — structured tabular data\n- [`clean-text-toolkit`](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit) — unstructured text\n- **`clean-log-toolkit`** — semi-structured timestamped logs\n\n## What this skill does\n\n- `scripts/parse.py` — parse a log file into structured rows. Auto-detects `apache-common`, `apache-combined`, `nginx-access`, `syslog`, and `json-line` formats by sniffing the first ~50 lines. Falls back to a generic timestamp + level + message extractor when nothing matches. Pass `--regex PATTERN` with named groups to define a custom format. Output as `.csv`, `.tsv`, or `.jsonl`.\n- `scripts/errors.py` — aggregate the errors in a log file. Counts by level (WARN / ERROR / FATAL by default), buckets the timeline by minute / hour / day, normalizes each message into a \"fingerprint\" (replaces numbers, UUIDs, hex tokens, file:line pairs, and embedded timestamps with placeholders) and surfaces the top-N most frequent error groups. Writes a JSON / Markdown / CSV report or prints a one-screen summary.\n- `scripts/grep.py` — grep, but log-aware. Combine `--pattern REGEX`, `--not-pattern REGEX`, `--level LVL[,LVL2...]`, `--since TIMESTAMP`, `--until TIMESTAMP`, and `-B / -A / -C` context lines into one filter pass.\n- `scripts/follow.py` (NEW in v0.2.0) — `tail -F` equivalent, log-aware. Streams new lines as they arrive with the same `--pattern` / `--not-pattern` / `--level` / `--since` filters as `grep.py`. Detects log rotation automatically (inode change or file truncation reopens the file). `--max-events N` exits cleanly after N matched events (CI-friendly); `--timeout SECONDS` exits on inactivity; `--json` emits per-line envelopes with extracted timestamp + level.\n- `scripts/check_deps.sh` — verify `python3` is avail"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7fkwsa5knkdkkachj1p7rwr9843xts\",\n  \"slug\": \"clean-log-toolkit\",\n  \"version\": \"0.2.0\",\n  \"publishedAt\": 1780595835710\n}"},{"path":"skill-card.md","content":"## Description:\n\nClean Log Toolkit helps agents inspect local log files by parsing common formats, aggregating errors, filtering by pattern, time, level, and context, following live logs, and producing structured reports without third-party dependencies or remote calls.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[gopendrasharma89-tech](https://clawhub.ai/user/gopendrasharma89-tech)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers, support engineers, and agents use this skill to inspect local log files, convert logs into structured outputs, find error clusters, filter incident windows by time, level, and pattern, and prepare reports for tickets or downstream analysis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Output files can overwrite source logs or symlink aliases, which can cause data loss.\n\nMitigation: Use a separate output directory and confirm output paths are not the original log path or a symlink to it before running parse, grep, or error-report commands.\n\nRisk: Generated reports can preserve sensitive raw log content.\n\nMitigation: Inspect and redact reports before sharing them in tickets, repositories, spreadsheets, or chat.\n\n## Reference(s):\n\n- [Clean Log Toolkit ClawHub skill page](https://clawhub.ai/gopendrasharma89-tech/skills/clean-log-toolkit)\n- [Clean Log Toolkit ClawHub homepage](https://clawhub.ai/gopendrasharma89-tech/clean-log-toolkit)\n- [Related Clean CSV Toolkit](https://clawhub.ai/gopendrasharma89-tech/clean-csv-toolkit)\n- [Related Clean Text Toolkit](https://clawhub.ai/gopendrasharma89-tech/clean-text-toolkit)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, CSV, TSV, JSONL, shell commands, guidance]\n\n**Output Format:** [Plain text summaries, filtered log lines, Markdown reports, JSON reports, CSV/TSV tables, JSONL rows, and shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces local stdout output or files at caller-provided paths; follow.py can stream matched lines as JSON envelopes.]\n\n## Skill Version(s):\n\n0.2.0 (source: release metadata and SKILL.md body)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."},{"path":"LICENSE","content":"MIT License\n\nCopyright (c) 2026 gopendrasharma89-tech\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex wi... Skill: Clean Log Toolkit Owner: gopendrasharma89-tech Summary: Local log file inspection and analysis toolkit. Parse common log formats (apache-common, apache-combined, nginx-access, syslog, JSON-line) or custom regex wi... Tags: agent:0.2.0, apache:0.2.0, errors:0.2.0, follow:0.2.0, grep:0.2.0, json-line:0.1.0, latest:0.2.0, live:0.2.0, log:0.2.0, nginx:0.2.0, observability:0.2.0, parse:0.2.0, stdlib:0.2.0, syslog:0","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1491,"uniquenessScore":47,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:32:01.884Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:32:01.884Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-14T00:03:17.684Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}