Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-05-27, 00:24:14

Author Topic: CSF Custom Regex  (Read 3807 times)

0 Members and 1 Guest are viewing this topic.

Offline Jimbohello

  • Valuable Member
  • *
  • Posts: 97
  • Karma: +0/-0
    • View Profile
CSF Custom Regex
« 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"

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.067 seconds with 17 queries.

web stats analysis