[Tutor] Parsing iptables log files

Sean 'Shaleh' Perry shalehperry@attbi.com
Tue, 3 Sep 2002 08:33:15 -0700


On Tuesday 03 September 2002 07:34, Amaya Rodrigo Sastre wrote:
> I see my web server is giving timeouts, so I moved the log and script t=
o
> http://www.lared.es/~amayita/python/ in case you want to take a look at
> it. Sorry for all the noise.

>>> already_read =3D []
>>> already_read
[]
>>> already_read.append(0)
>>> already_read
[0]

as you can see .append(0) made already_read[0] =3D 0, no reason to do it =
by hand=20
again.

You are getting:

Traceback (most recent call last):
  File "./amaya.py", line 103, in ?
    if (already_read[j] =3D=3D 0):
IndexError: list index out of range

because you are accessing already_read[1] which does not exist, your scri=
pt=20
only creates the [0] entry.

I see nothing obviously wrong with the commented out regex section it is=20
actually failing later in the script.