Filter out cPanel system logs from 500 error tracker

FILTERED LOG FILES:
- proxy (Apache reverse proxy logs)
- localhost (local connections)
- default (default vhost)
- cpanel, webmail, whm (cPanel services)
- cpcalendars, cpcontacts, webdisk (cPanel apps)

These are cPanel system services, not actual customer domains.
They were showing as 'unknown' user and cluttering results.

Now only tracks actual customer domain 500 errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cschantz
2025-11-03 20:42:56 -05:00
parent e4eaf9afb5
commit 585785847b
+4 -1
View File
@@ -58,9 +58,12 @@ total_500s=0
for log in "$DOMLOGS_DIR"/*; do
[ -f "$log" ] || continue
[[ "$log" =~ (bytes_log|offset|error_log|ftpxferlog|-ssl_log)$ ]] && continue
domain="${log##*/}"
domain="${domain%%-*}"
# Skip non-domain system logs (proxy, localhost, etc.)
[[ "$domain" =~ ^(proxy|localhost|default|cpanel|webmail|whm|cpcalendars|cpcontacts|webdisk)$ ]] && continue
# Find cPanel user for this domain
user=$(grep -l "DNS.*$domain" /var/cpanel/users/* 2>/dev/null | head -1 | xargs basename 2>/dev/null)