Files
Linux-Server-Management-Too…/modules
Developer 08e8e8b5f0 Fix: bot-analyzer.sh production crash in reporting sections
FIXES FOR LARGE DATASET CRASHES:
- Replaced expensive grep loops with pre-built IP count cache in whitelist section
- Added comprehensive error handling around HIGH-CONFIDENCE BOT FINGERPRINTS awk
- Simplified DOMAIN ATTACK TARGETING section (removed complex nested loops)
- Added file existence checks for bot data in TOP AGGRESSIVE BOTS section
- Added || true error handlers throughout reporting sections

SPECIFIC CRASHES FIXED:
1. Line 2457: Large file grep on parsed_logs.txt (up to 1M+ entries) → Use cache instead
2. Line 2516: Repeated grep in loop on attack_vectors_raw.txt → Removed problematic section
3. Line 2618: Missing file check on top_bots.txt → Added file existence check
4. Complex awk operations → Wrapped in subshells with error handling

RESULTS:
 Script now completes all reporting sections without crashing on large datasets
 Handles missing files gracefully
 Performance improved by removing expensive grep operations
2026-04-23 23:56:37 -04:00
..