[Tutor] regex

Will Harris mosinu at gmail.com
Tue Dec 27 08:05:21 CET 2005

Does anyone see anything that jumps out at them on why these regex strings
aren't catching this line:

Dec 18 10:04:45 dragon logger: TCPWRAP: SERVICE=sshd@::ffff:

This is the output of a tcpwrapper script I have, I am trying to write a
script to parse this and tell me how many times host_address X has been
denied access (among many other things). I have it working for the firewall
rules just fine, but I am missing something somewhere to catch the string
above. Below are the regex expressions I have tried:

initial regex to find the line and pass it back to the routine to sort all
this out. This line works, I believe (least I can get it to print all the
entries back to me I am looking for.
rc('logger\S*\sTCPWRAP') : self.twist_failure
Here is where I seem to run into trouble, none of the regex strings I have
used seem to catch and sort out the strings.
self.twist_fail_re =
rc is set as rc = re.compile at the early part of my script. I have tried
every combination I can think of for the expression above, below are the
couple I still have written down.
self.twist_fail_re =
self.twist_fail_re =

But for some reason they are not picking up the strings. Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051227/5c8ba3d1/attachment.htm

More information about the Tutor mailing list