investigating-logs
What it does
This skill reads your PostHog logs to answer whether a service is healthy, what caused an error spike, or what a log stream is saying. It is for developers and on-call staff who need answers quickly.
When to use it
- ✓When you want to check whether a service or deployment is working after a change.
- ✓When errors have gone up and you want to know what changed.
- ✓When you need the log evidence for a failure reported by an alert or a user.
Skill link
https://github.com/PostHog/posthog/blob/master/products/logs/skills/investigating-logs/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Did my last deploy break anything? Check the logs and tell me what changed.”
5 new skills a week. 1 minute to read.
How it works
It first groups the logs into repeated patterns and compares them with an earlier time, so you see what is different. Only at the end does it read the raw log rows.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Investigating logs
Investigation is a narrowing problem: summarize before you read.
One posthog:logs-patterns call compresses millions of lines into at most 200 templates,
and one posthog:logs-patterns-diff call answers "what is different about now vs. before" directly.
Raw rows (posthog:query-logs) are the last step of an investigation, never the first.
When to use this skill
- "Check the logs" / "is service X healthy?" / "did my deploy (or model bump, config change, migration) break anything?"
- "Why are errors up?" / "explain this spike" / incident triage — "what changed?"
- "What is this service logging?" — orienting in an unfamiliar or noisy stream.
- Finding the log evidence for a failure reported elsewhere (an alert, an error-tracking issue, a user complaint).
When not to use this skill
- Creating or tuning log alerts — that's
authoring-log-alerts. - Analytics over product events, persons, or insights — that's
querying-posthog-data. - HogQL exposes a
logstable viaposthog:execute-sql, but do not investigate through it: hand-written SQL over logs routinely hits read-byte caps and re-derives what the tools below do in one cheap call. Reserve SQL for the rare case of joining log-derived facts with non-log data.
Tools
| Tool | Job |
|---|---|
posthog:logs-services-create |
Top-25 services with log_count, error_count, error_rate, sparkline. Orientation. |
posthog:logs-patterns |
Mine one window's message templates, ordered by frequency. "What is this stream saying?" |
posthog:logs-patterns-diff |
Diff templates between two windows: new / rate-shifted / gone. "What changed?" |
posthog:logs-count / posthog:logs-count-ranges |
Scalar and time-bucketed counts for a filter. Localize volume before pulling rows. |
posthog:logs-sparkline-query |
Volume over time broken down by severity or service (the one bucketed view with a breakdown). |
posthog:logs-facet-values-create |
Distribution of severity/service (or a resource attribute) under a filter. |
posthog:logs-attributes-list / posthog:logs-attribute-values-list |
Discover attribute keys and values before building filters. |
posthog:query-logs |
Raw rows. Endpoint of every drill-down, entry point of none. |
Each tool's own description documents its parameters and response shape — read it before calling.
Pick the workflow by question shape
"Is it healthy?" — post-deploy / post-change verification
The user changed something (deploy, model bump, config, migration) and wants to know the logs still look right.
- Pin down the change time and the affected service(s). Ask if the user hasn't said; the diff is meaningless without a boundary.
- Orient with
posthog:logs-services-create: is the service still logging at all, and what is its error_rate now? A service that went silent fails verification just as hard as one that started erroring. posthog:logs-patterns-diffwithquery.dateRangefrom the change time to now andbaselineDateRangeset to a comparable window just before the change, scoped toserviceNames. New error/fatal templates right after a change are the classic regression signature; largerate_ratioshifts on existing error templates are the second thing to check.- Check volume continuity with
posthog:logs-count-rangesspanning before and after the boundary: a rate discontinuity (crash loop, restart storm, silence) shows up here even when message content looks unchanged. - Drill only the suspects: pivot each suspicious pattern to raw lines via its
match_regexwithposthog:query-logs.
A pass verdict needs all three: no new error templates, no large error rate_ratio shifts, and continuous volume. Say which windows you compared — "healthy" is o
FAQ
Why not read the raw log rows first?
There are too many rows to read, so the summary shows the important patterns first.
Should I write SQL to query the logs?
Not usually. The skill recommends its summary tools, because hand-written SQL over logs often hits read limits.
Can it create alerts too?
No. Creating or tuning log alerts is handled by a separate skill.
Details
Original description by the author
Investigate logs in a PostHog project: verify a service or deployment is healthy, explain an error spike, triage an incident, or understand what a log stream is saying. Use when the user asks to "check the logs", asks whether a service, deploy, release, or change is working or broke anything, asks why errors are up or what changed, or wants the root cause of failures visible in logs. Routes the logs MCP tools (services overview, pattern mining, before/after pattern diffing, bucketed counts, facets, raw rows) so investigations start from summaries instead of raw rows or hand-written SQL over th
repo: PostHog/posthog
Popularity
- GitHub stars
- 41k
- Ranking position
- #6889
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
depot-ci
41kHelps your agent set up and run Depot CI workflows, a GitHub Actions alternative, including migrating existing workflows and reading run logs.
depot-container-builds
41kHelps your agent build Docker images on Depot's remote builders, including multi-platform images, pushing to registries, and fixing build failures.
depot-github-runners
41kHelps your agent move GitHub Actions jobs to Depot-managed runners, choosing runner sizes and labels, and troubleshooting runner setup issues.
editing-agents-md
41kHelps your agent decide whether a rule belongs in an AGENTS.md or CLAUDE.md file, and write it so it sticks without bloating the file.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.