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.
This commit is contained in:
@@ -62,6 +62,9 @@ for log in "$DOMLOGS_DIR"/*; do
|
||||
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)
|
||||
[ -z "$user" ] && user="unknown"
|
||||
|
||||
Reference in New Issue
Block a user