Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I can't get a failregex to match my Hiawatha webserver logs! The log files use "Common Log Format" where the host IP is before the date, but I can't seem to match this with a failregex which wants the date before the IP. Have I missed something obvious?
Yes, wasn't sure where to ask this! I tried "<HOST>.*GET.*" just to get a match, but get reply "Found a match... but no valid date/time found..." from fail2ban-regex. I also tried various mutations of this regex but get either no match at all, or the found match/no date messages.
However, look at the above section 'Running tests' which could contain important information.
...Output ends
I have tested this and it works - thanks for the help, though I will have to study this to understand what is happening. Perhaps you could also point in the right direction for the standard Hiawatha log format?
They look like this:
I thought I had some understanding of regexes but this has me totally stumped. I cannot work out a regex to match the Hiawatha standard log format, probably because I can't understand why the regex supplied by unSpawn works. Can you help - I'm feeling very stupid here.
I think your best bet is to look into the regexes as they are used in /etc/fail2ban/.*/.* and maybe an "easier" Hiawatha log format. Clearly I'm trying to avoid compiling Hiawatha to find out which log format would be more "default" than your current one but I'd venture it's "LogFormat=extended".
I think I have figured it out!!! The Hiawatha default log date format is Day DD Mon YYYY:hh:mm:ss (or "%a %e %b %Y %H:%M:%S %z") which it seems fail2ban doesn't support.
Thanks to unSpawn for helping me along the path to understanding!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.