Fun with httpd logs and code red

Graham Ashton graz at mindless.com
Mon Aug 20 07:26:39 EDT 2001


Stephen Boulet wrote:

> Just for fun, I wrote the following script to check my apache log for 
> recent code red queries:
> 
>                 if string.find(line, "GET /default.ida"):

Shouldn't that say:

    if string.find(line, "GET /default.ida") != -1:

instead?

Otherwise it just counts the number of unique IP addresses in your access
log, as -1 is true. Perhaps you'll find you had fewer code red hits after
that.

--
Graham



More information about the Python-list mailing list