Fun with httpd logs and code red

Stephen Boulet spboulet at speakeasy.net
Mon Aug 20 08:08:48 CEST 2001


Graham Ashton wrote:

> 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

Thanks for pointing that out. Actually it found one more item than the 
previous total with the correction in place (my log contains nothing but 
code red entries since I only use it as a test site).

I'll have to see what's possible as far as getting back to the people goes.

- Stephen



More information about the Python-list mailing list