RE: Online custom logging
Posted in 2003
Michael Pisula wrote
>
> In IDS 9.30, is it possible to add the 'Date' of the event to the
> timestamp. So a typical log is now:
>
> 09:51:47 Maximum server connections 70
> 10:01:49 Fuzzy Checkpoint Completed: duration was 2 seconds, 1487> buffers not flushed.
> 10:01:49 Checkpoint loguniq 16932, logpos 0x2561740>
> It'd be great to have it be something like:
>
> 05/10/2003 09:51:47 Maximum server connections 70
> 05/10/2003 10:01:49 Fuzzy Checkpoint Completed: duration was 2
> seconds, 1487 buffers not flushed.
> 05/10/2003 10:01:49 Checkpoint loguniq 16932, logpos 0x2561740
>
> or similar.
If you have got a decent operating system (ie not Windows) you can easily
set up
a script to parse the log through awk and show the date -
# datedlog.sh
awk '$1 ~ /Sun|Mon|Tue|Wed|Thu|Fri|Sat/ { DATE = $3 "/" $2 "/" $5
}
{ print DATE , $0 }
' $INFORMIXDIR/log/online.log | more
Note : All brackets are curly.
This a bit rough and ready. I will try and repost with the month in numeric
using
associative arrays when I am not so busy, unless Jack rises to the challenge
in the mean time. Order of printing the fields might heve to be changed
depending
on US or European date format.
Colin Bull
c.bull@videonetworks.com