Skip to content
Back to skills

12 Log Analysis

ASecurity

Use to parse and correlate security logs or build SIEM queries and detection rules. For incident coordination and forensic evidence handling, use 07-incident-response.

  • 2 stars
  • 0 votes
  • 0 copies
  • 11 views
  • Added June 5, 2026
securitypythongobashgitsecuritydocumentation

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 5 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add Masriyan/Claude-Code-CyberSecurity-Skill --skill 12-log-analysis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 12 Log Analysis?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 12 Log Analysis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/masriyan-12-log-analysis/badge)](https://www.skillsdirectory.com/skills/masriyan-12-log-analysis)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: 12-log-analysis
description: Use to parse and correlate security logs or build SIEM queries and detection rules. For incident coordination and forensic evidence handling, use 07-incident-response.
metadata:
  author: Masriyan
  version: 1.0.0
  tags: cybersecurity, log-analysis, siem, splunk, elastic, anomaly-detection, correlation
---

# 📊 Log Analysis & SIEM Integration

## Overview

Use this skill for security log analysis, SIEM query construction, anomaly detection, correlation rule development, and log pipeline optimization across multiple platforms (Splunk, Elastic, QRadar, Microsoft Sentinel).

---

## Prerequisites

- Python 3.8+
- `pandas`, `pyyaml`

```bash
pip install pandas pyyaml python-dateutil
```

---

## Core Capabilities

### 1. Log Parsing & Normalization

**When the user asks to parse logs:**

1. Auto-detect log format (syslog, JSON, CSV, Windows Event, CEF, LEEF)
2. Parse and extract structured fields
3. Normalize timestamps to UTC
4. Map fields to common schema (ECS, CIM, OCSF)
5. Handle multi-line log entries
6. Output in structured format (JSON, CSV)

### 2. SIEM Query Building

**When the user asks to build SIEM queries:**

**Splunk SPL:**

```spl
index=windows sourcetype=WinEventLog:Security EventCode=4625
| stats count by src_ip, Account_Name
| where count > 5
| sort -count
```

**Elastic KQL/EQL:**

```
event.code:4625 AND source.ip:* | stats count by source.ip, user.name
```

**Microsoft Sentinel KQL:**

```kql
SecurityEvent
| where EventID == 4625
| summarize FailedLogons=count() by SourceIP=IpAddress, Account=Account
| where FailedLogons > 5
```

### 3. Anomaly Detection

**When the user asks to detect anomalies:**

1. Establish baseline behavior from historical data
2. Detect statistical anomalies (volume spikes, new patterns)
3. Identify never-before-seen events
4. Detect timing anomalies (off-hours activity)
5. Flag geolocation anomalies (impossible travel)
6. Identify behavioral deviations from baselines

### 4. Correlation Rule Development

**When the user asks to create correlation rules:**

1. Define the attack scenario to detect
2. Identify the individual log events involved
3. Build temporal correlation logic (events within time window)
4. Add context enrichment (asset criticality, user roles)
5. Set threshold conditions
6. Define suppression and de-duplication logic
7. Generate Sigma rules for platform-agnostic detection

### 5. Log Source Health Monitoring

**When the user asks about log source health:**

1. Monitor log volume per source for gaps
2. Detect silent log sources (no events received)
3. Validate expected event types are present
4. Check timestamp accuracy and drift
5. Alert on parsing errors or format changes

---

## Usage Instructions

### Example Prompts

```
> Parse these Windows Event Logs and extract authentication events
> Build a Splunk query to detect lateral movement via PsExec
> Create a correlation rule for detecting brute force followed by successful login
> Analyze these logs for anomalous behavior patterns
> Convert this Splunk query to Elastic KQL
> Build a Sigma rule for detecting credential dumping
```

---

## Script Reference

### `log_parser.py`

```bash
python scripts/log_parser.py --input /var/log/auth.log --format json --output parsed.json
python scripts/log_parser.py --input events.evtx --normalize ecs --output normalized.json
```

### `anomaly_detector.py`

```bash
python scripts/anomaly_detector.py --logs parsed.json --baseline baseline.json --output anomalies.json
```

---

## Integration Guide

- **← CSOC Automation (11)**: Receive triaged alerts for deep log analysis
- **← Incident Response (07)**: Provide log evidence for IR timelines
- **→ Threat Hunting (06)**: Feed anomalies as hunt leads
- **→ Blue Team Defense (15)**: Generate detection rules from findings

---

## References

- [Splunk SPL Reference](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference)
- [Elastic EQL](https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html)
- [Sigma Rules](https://github.com/SigmaHQ/sigma)
- [OCSF Schema](https://schema.ocsf.io/)

Files in this skill

  • SKILL.md14.4 KB
  • examples/example_usage.md206 B
  • scripts/__pycache__/log_parser.cpython-314.pyc12 KB
  • scripts/anomaly_detector.py18.2 KB
  • scripts/log_parser.py7.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.