Use when (1) user pastes server, application, or system log text and wants to extract error patterns into structured alert rules. (2) user says "create alerts from these logs", "monitor for this error", "set up alerts for this pattern", or "extract warning conditions". (3) user pastes log output and asks "alert me if this happens again".
This skill solves the specific problem of: recurring errors in logs need to become automated alert rules — not just documented, but actively monitored.
This skill IS NOT:
This skill IS activated ONLY when: log text + alert creation intent are both present.
/log-to-alert#Default mode. Parses log entries, identifies error/warning patterns, and outputs structured alert rules.
When to use: User provides log text and wants alert rules (Prometheus, PagerDuty, Grafana, etc.)
/log-to-alert/dedupe#Groups similar log lines into a single alert rule, eliminating duplicates.
When to use: Log contains many repeated instances of the same error.
level, message, timestamp, serviceERROR / FATAL / CRITICAL → high severityWARN / WARNING → medium severityINFO / DEBUG → informational (usually not alert-worthy)For each error class found:
FieldSourceAlert nameDerived from error type + service nameMatch patternRegex extracted from error message templateSeverityFrom log level (ERROR→critical, WARN→warning)Source serviceFrom log source field or filenameFrequency thresholdTrigger count before alert fires (default: ≥3 in 5 min)
Output in the target system's format:
Prometheus AlertManager:
yaml
- alert: HighMemoryUsage
expr: node_memory_MemAvailable / node_memory_MemTotal < 0.1
for: 5m
labels:
severity: critical
annotations:
summary: "High memory usage on {{ $labels.instance }}"
Generic alert spec:
json
{
"name": "DatabaseConnectionFailed",
"pattern": "Connection refused|Connection timeout",
"severity": "critical",
"threshold": 3,
"window": "5m",
"action": "notify"
}
A good output:
A bad output:
ScenarioBad OutputGood Output500 identical error lines500 separate alert rules1 alert rule with threshold=3Dynamic error messagePattern matches literal stringPattern uses regex: user \d+ not foundMultiple services in logsAll alerts named "Error"Alerts named by service: auth-DB-connection-failedOne INFO log lineCreates an alertSkipped — INFO not alert-worthy
references/ — Regex extraction patterns, alert format schemas for Prometheus/Grafana/PagerDuty