# Python for SOC Analysts

> Read, parse and review the small Python scripts that sit in a SOC: failed login counters, regular expression parsers, JSON and CSV joiners and enrichment helpers.

Canonical: https://codelivly.com/rooms/python-for-soc-analysts
Last updated: 2026-11-23

| | |
|---|---|
| Level | Intermediate |
| Category | Cybersecurity |
| Lessons | 5 |
| Estimated time | 2 h 48 min |
| XP | 982 |

This room follows Monday 7 June at Kestrel Logistics, when Mina Castellan asks for reviews of three scripts before anyone runs them on live data. You learn to read a script in a fixed order, to pull fields out of log lines with regular expressions and count what the parser skipped, and to work with JSON and CSV without losing rows or crashing on a missing field. You also learn what to check before a script touches real data: secrets, timeouts, error handling, dry runs, allowlists and tests. Python is not installed in the lab, so every exercise reads the script and rebuilds its result with shell tools. The last lesson is a Guided Lab where you review a broken triage script, find the faults and write the sign off note.

## Lessons

1. Reading a Triage Script Line by Line (30 min)
2. Parsing Logs with Regular Expressions (32 min)
3. Working with JSON and CSV (32 min)
4. Testing and Reviewing a Script Before It Runs on Real Data (34 min)
5. Guided Lab: Review and Fix a Triage Script (40 min)

## Related

- [Learning path: SOC Automation and Engineering](https://codelivly.com/learning-paths/soc-automation-and-engineering)
- [All rooms](https://codelivly.com/rooms)
