I have wordpress on two web server nodes behind a loadbalancer server. and I log "failed login IPs" on web nodes in a file in order to use this custom regex on it:
Code: Select all
if (($globlogs{CUSTOM1_LOG}{$lgfile}) and ($line =~ /^(\d+\.\d+\.\d+\.\d+)/)) {
return ("Failed Wordpress login from",$1,"wordpresslogin","5","80,443","3600","0");
}
Code: Select all
#!/bin/bash
WEB1_IP="X.X.X.X"
WEB2_IP="Y.Y.Y.Y"
LOG_URL="/login_logs.txt"
LOG_PATH="/home/login_logs.txt"
wget -q -O - "$WEB1_IP""$LOG_URL" | tail -n+2 > "$LOG_PATH"
wget -q -O - "$WEB2_IP""$LOG_URL" | tail -n+2 >> "$LOG_PATH"