You are not logged in.
i'm trying to get blockhosts to work, but i don't think it's matching.
here's a snippet from my auth.log
Jan 15 09:28:11 myhostname (IDLE)[19960]: (?@217.26.64.149) [WARNING] Authentication failed for user [admin]
here's the regex that should match it in /etc/blockhosts.cfg
"PureFTPD-Fail": re.compile(r"""pure-ftpd: (?@(?P<host>d{1,3}.d{1,3}.d{1,3}.d{1,3})) [WARNING] Authentication failed"""),
call me lazy, but i'm sure some expert here can solve this in 2 seconds while it would take me 2 hours to figure out the syntax.
thanks!
Offline
It's clear that your regex will miss this line. For starters, your regex is looking for a match to find 'pure-ftpd:' which doesn't exist in your sample line. Also, your RE expects a match to end with 'Authentication failed'. Again, this is not the case in you sample line.
I don't see why you need the r"""...""". What's wrong with single quotes?
That aside, if you change your RE to
re.compile(r'(?@(?P<host>d{1,3}.d{1,3}.d{1,3}.d{1,3})) [WARNING]')
Then then 'host' group is matched ok.
Get hold of Pyreb (in the AUR) for testing with REs.
Offline