Regex CSF custom log path

mikussikus

Verified User
Joined
Dec 21, 2022
Messages
21
I have regex in csf to lock wp-login.php in wordpress and it works. Now I want to add a new regular expression but I don't know which path I need to add in csf.conf. Such as Custom1_log or diffrent ?
 

Attachments

  • custom_log.jpg
    custom_log.jpg
    34.2 KB · Views: 107
I'm trying to help, but I dont understand your problem. With CSF you can block IP addresses that might be poking at your wp-login.php and you do this by writing a regular expression and adding it to /usr/local/csf/bin/regex.custom.pm

You also have to tell CSF where to look for these attempts. That might take the form of /var/log/httpd/domains/YOURDOMAINNAME.com.log, which you would add to customlog in csf.conf. Is this close to what you were looking for?
 
Hey,
I have no problem with regex. I need an explanation where I should save the second custom2_log. In the same path as custom1_log?

I thought that I going to create new folder which name CSF inside domains path like this /var/log/httpd/domains/csf/*.log and I will save logs there. But this solution doesn't work.
 
I perhap found where was a problem. In regex custom csf i have two regexes(screen) and when I set the same Custom1_log everything works great. Tell me is it correct?
 

Attachments

  • regex.png
    regex.png
    11.6 KB · Views: 136
There are two things you need to do to make this work (CSF needs to know what to look for and where to look for it)
1 - You can add as many regex statements as needed to /usr/local/csf/bin/regex.custom.pm and in those statements you specify where you want CSF to look for the pattern (CUSTOM1_LOG, CUSTOM2_LOG...). If you have multiple logs you want CSF to check for this pattern, you need to repeat the regex statement with a second (or third...) log part of the statement.
2 - You need to tell CSF where to look. Again, this could be one log or multiple logs. You don't create a log file, you point CSF to a log file where the webserver will be logging these patterns that your regex statement looks for. You save these CUSTOM1_LOG paths to the CSF configuration file.
 
Back
Top