$cd ../use-cases/
πΎ Developerv1.4+5 min setup
$ cat log-analyzer.md
AI Log Analyzer & Guard
/** Monitor server logs in real-time with zero performance overhead. OpenClaw uses eBPF-adjacent log observation to detect anomalies before they become outages. */
observer_architecture.log
Zero-Copy Log Observation
Traditional log analysis often introduces heavy I/O overhead. OpenClaw's Log Analyzer employs a 'Passive Observer' pattern, tailing systemd-journald and standard application logs without duplicating disk data. By running locally, it ensures your sensitive access logs never leave your network while providing cloud-level intelligence.
analysis_pipeline.md
βοΈ Analysis Workflow
1
Streaming Observation
Native support for Nginx, Apache, Fail2ban, and Docker container streams.
2
Sub-Second Pattern Matching
Detects SQL injection attempts, SSH brute-force, and unusual volumetric spikes.
3
Contextual Escalation
Routes high-severity incidents to Claude 3.5 for an instant post-mortem analysis.
4
Active Remediation
Auto-apply UFW rules, trigger Cloudflare SDK blocks, or restart specific microservices.
rules.yaml
βοΈ Rule Engine Configuration
# OpenClaw Log Sentinel Configuration
rules:
- name: "auth-failure-burst"
threshold: 10
window: "60s"
action: ["ufw-block", "slack-alert"]
- name: "high-latency-endpoint"
condition: "request_time > 2.0"
escalate: "claude-3-5"
π‘# π‘ Pro Tip: Use 'severity: high' to trigger voice alerts on your OpenClaw desktop instance.
alert.log
π Anatomy of an AI Alert
Critical Incident Detected
Type: HTTP 5xx Spike (Anomaly Rank: 0.94)
Source: nginx.access.log
Payload: SELECT * FROM users WHERE id=1' OR '1'='1
AI Summary: SQL Injection attempted from IP 45.148.10.x. Pattern matched known vulnerability scanners.
UFW BLOCKED
SENT TO SLACK
π Integration Ecosystem
β FAQ
Q1. Which log formats does it support?
Nginx access/error, Apache, systemd-journald, Docker container logs, Fail2ban, and custom formats via regex. New parsers can be added with a YAML config file.
Q2. Does it affect server performance?
Negligible. The 'Passive Observer' pattern tails logs in read-only mode without duplicating data. CPU usage stays under 2% even at 10,000+ log lines per second.
Q3. Can it auto-block attackers?
Yes. When configured, it auto-applies UFW rules, triggers Cloudflare firewall blocks, or bans IPs via Fail2ban β all within seconds of detection.
Q4. How does AI analysis differ from regex rules?
Regex catches known patterns. The AI catches novel threats by understanding context β e.g., detecting a slow SQL injection attempt spread across 50 requests that no single regex would flag.
Q5. Is log data sent to any cloud service?
Never. All processing happens locally. Even with API-based LLMs, only the extracted alert text (not raw logs) is sent for analysis.