MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Tips and Tricks => Topic started by: Jimbohello on 2015-04-01, 22:01:21

Title: CSF Custom Regex
Post by: Jimbohello on 2015-04-01, 22:01:21
nano /usr/local/csf/bin/regex.custom.pm

add the following line

# vpopmail " User not found "
if (($globlogs{CUSTOM1_LOG}{$lgfile}) and ($line =~ /^\S+\s+\d+\s+\d+:\d+:\d+\s+\S+\s\S+\s+\S+ vpopmail user not found \S+?@:(\d+.\d+.\d+\.\d+)/)) {
                return ("user not found",$1,"vpopmail","1","25,110,143,465,587","1");
}

# httpd "File does not exist"
if (($globlogs{CUSTOM2_LOG}{$lgfile}) and ($line =~ /^\[\S+\s+\S+\s+\S+\s+\S+\s+\S+\] \[error\] \[client (\S+)\] File does not exist:/)) {
        return ("File does not exist",$1,"Apache",2,"80,443","1");
}

# httpd "invalid request"
if (($globlogs{CUSTOM2_LOG}{$lgfile}) and ($line =~ /^\[\S+\s+\S+\s+\S+\s+\S+\s+\S+\] \[error\] \[client (\S+)\] invalid request:/)) {
        return ("invalid request",$1,"Apache",2,"80,443","1");
}


After that
nano /etc/csf/csf.conf
completely in the bottom


CUSTOM1_LOG = "/var/log/maillog"
CUSTOM2_LOG = "/var/log/httpd/error_log"