Page 1 of 1
New (v 1.2) Error table
Posted: Wed Jul 10, 1996 4:59 pm
by Thunderstone
The new table is a fine idea... but it really needs to be
extended a little. It acts like an "error log", but it
REALLY needs to log the date/time of the error. The
utility of the table would be greatly improved if you
would add a date/time field.
Currently, I'm still stuck parsing gw.log looking for the
"Document not found" messages since gw.log has a timestamp.
Of course my error counts did take a (temporary) dramatic downturn
while my scripts were still looking for "Can't access document".
Cheers,
Gary Alderman
New (v 1.2) Error table
Posted: Wed Jul 10, 1996 5:09 pm
by Thunderstone
Try this:
gw -st "select convert(id,'date'),Url,Reason from error"
Or:
gw -s "select convert(error.id,'date') Date,refs.Url Page,error.Url Error,error.Reason from error,refs where refs.Ref=error.Url"
The id field contains the date (and sequence number) the record was inserted.
convert() can be used to get it into a pure date format.
New (v 1.2) Error table
Posted: Wed Jul 10, 1996 10:15 pm
by Thunderstone
I forgot to mention that the id field can also be treated as a date
for comparison purposes in a "where" clause. Just specify the date
in the format: YYYY-MM-DD optionally followed by space and HH:MM:SS .
gw -st "select convert(id,'date'),Url,Reason from error where id>'1996-07-01'"
gw -st "select convert(id,'date'),Url,Reason from error where id>'1996-07-08 17:30:00
Dates can also be specified in a relative form using plus or minus sign
followed by a number and units (seconds,minutes,hours,days,weeks,months,years)
as in:
-1 hour (one hour ago from now)
-3 days (three days ago from now)
gw -st "select convert(id,'date'),Url,Reason from error where id>'-1 day'"
New (v 1.2) Error table
Posted: Thu Jul 11, 1996 2:32 am
by Thunderstone
Actually, I'm a little mystified about how the time-stamp helps ?
HOWEVER! You can convert the id field of the error table into
a time. Try this:
gw -s "select convert(error.id,'date') When,refs.Url Page,error.Url Error,error.Reason from error,refs where refs.Ref=error.Url"
If you want to know all the errors in the last day try this:
gw -s "select convert(error.id,'date') When,refs.Url Page,error.Url Error,error.Reason from error,refs where refs.Ref=error.Url and error.id > '-1 day'"
For a comma separated report use : gw -sc instead of gw -s
For more info on Texis SQL time conversions see:
http://www.thunderstone.com/texisman/node63.html
For more on the "convert" function itself see:
http://www.thunderstone.com/texisman/node72.html
To you as well,
Bart Richards
Thunderstone