# Analyze logs to find what went wrong

Reads logs to identify errors, patterns, and the likely root cause.

- Topic: Software Development
- Framework: Few-Shot
- Level: Standard
- Tags: Analyze, Plan, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/analyze-logs-to-find-what-went-wrong

## Prompt

```text
Analyze these logs and help me find what went wrong.

**System and component:** [e.g. Nginx, Kubernetes pod, Node API, Windows event log]
**What users noticed and when:** [SYMPTOM, TIME WINDOW, timezone]
**Recent changes:** [deploys, config changes, traffic spikes]
**Logs:**
[PASTE — redact secrets, tokens, and personal data]

Deliver:
1. A timeline of significant events.
2. Errors and warnings grouped by type, with counts and first/last occurrence.
3. Anomalies and correlations (e.g. latency spikes, retries, a resource exhausted just before errors began).
4. The most likely root cause and your confidence level, with the evidence.
5. Next diagnostic steps (exact commands or queries) and a suggested fix.
6. Monitoring or alerting that would have caught this sooner.
```

## What to fill in

- e.g. Nginx, Kubernetes pod, Node API, Windows event log
- SYMPTOM, TIME WINDOW, timezone
- deploys, config changes, traffic spikes
- PASTE — redact secrets, tokens, and personal data

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
