log-triage
Find what actually went wrong in log files. Use when the user asks for a root cause, an incident summary, anomalies, errors, failures or "what happened" in system, application, server, cluster, device or audit logs. Its triage_logs tool reads every file over its full range, keeps steady baseline noise apart from anomalies, finds bursts with exact first and last timestamps, and lists the hosts and ids an incident hit.
- Star
- 1,661
- 分类
- 运维与云
- 许可证
- MIT
- 最近提交
- 2026年12月1日
hub/skills/log-triage/SKILL.md
在 GitHub 上查看Log Triage
The loudest message in a log is usually routine. The incident is the rare, severe message that hit many hosts at once, often in a few minutes of a multi-day file. Counting by volume finds the noise; this skill finds the incident.
Hard rules
- Call
log-triage/triage_logsfirst. It reads every file over its full range (streaming, read-only, any size,.gzincluded). Never read a large log into the conversation instead: you will see the start and report it as the whole. - Do not report from a misread file.
checks.okmust be true. Ifparsed_share_okis false, call again withtimestamp_regex(andlevel_regex/host_regex) fitted to the file'sunparsed_samplesorline_samples. If its lines truly carry no timestamp, say that the file was counted but not ranked by time. - Deliver lists from
triage_logsoutput; do not rebuild them by hand. A list of failed requests, sessions or jobs isentities.list. When the user wants a list file, passoutput_pathon the first call (a new.csvor.txt, outside the log folder or under a name of its own), so the logs are read once;outputreturns the path, the count and theshareof all entities.status: partialmeans the file was not written: say so, with theerror. Say how many were flagged out oftotal. - A list of most entities is not an anomaly list. When
entity_list_warningis present (over a third flagged), do not deliver the list: call again withentity_max_share=0.33(templates rare relative to all entities) orentity_min_level="ERROR"(error-bearing templates only), or report the share itself as the finding. - Baseline is not the incident, unless it is the whole log. Report
baselinetemplates once as background, never in an anomaly total. Steady ERROR or FATAL templates inpersistent_errorsare either routine or an outage that covers the whole log: say which reading the evidence supports, and ask the user when the log cannot tell. - Quote, do not round. Copy every timestamp, count and host number exactly as the result prints it.
- Base every finding on lines in the logs you were given; do not fill gaps from memory.
Procedure
triage_logs(paths=[folder or files]). Addglob="*.log"for a mixed folder,bucket="1min"for a short incident,entity_regexfor the id the user asked about.- Check
checks, thencoverage: every file, its first and last timestamp, andtimes_in(UTC or as written). - Read
anomalies(ranked by severity, hosts hit, rarity) andbursts(exactstart/end;vs_quiet_windowshows whatroseand whatfell_silent). - Read the lines before the first burst line with the
read_filecall innext_step. Causes come before their symptoms. - Write a blameless postmortem: Summary, Impact, Detection, Timeline, Contributing factors, Mitigation, Action items (owner from the user's context, else "owner: to assign"), Confidence. Close with Baseline and Limits, and repeat every warning that limits the answer.
Example (invented): "Summary: storage controller resets on 17 of 24 hosts, 2025-03-05 07:18:51 to 07:21:49 UTC, 90 FATAL lines from a template seen nowhere else in the 2-day log. Impact: 17 jobs aborted. The 1,440 request timeouts are baseline: steady across the whole range."
References (paths relative to this skill's folder)
references/result-fields.md- read when a result field, clock offset, quiet host or warning needs interpreting.references/entity-lists.md- read when the user asks for a list of anomalous ids, or the list looks too broad.references/postmortem.md- read when writing the report, for what each section must contain.references/fallback-python.md- read only whentriage_logsis not available or a file stays unparsed withtimestamp_regex. It inventories withlist_files, samples withread_fileand parses withrun_python.
Fork this
Pin timestamp_regex, level_regex, host_regex and entity_regex in step 1
to your platform's log format, and add the templates your team already knows
are harmless to a baseline list, so the report starts from the unfamiliar.
相似的 Skill
canary
GAgarrytan/gstack143k近 7 天新增 524 个 star
observability-and-instrumentation
ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star
paperclip-board
PApaperclipai/paperclip119k近 7 天新增 1,727 个 star
ruview-configure
RUruvnet/RuView106k近 7 天新增 596 个 star