Time Stamping Events

Place for people to discuss public servers, and also for admins to lay out the details of their servers
Post Reply
SilentSwan
Private First Class
Private First Class
Posts: 99
Joined: Fri Jan 21, 2005 4:23 am
Location: Gone

Time Stamping Events

Post by SilentSwan »

Is it possible to timestamp events in bzadmin? I'm using this to log activity on the server, but without times, it's not really all that useful.
Thanks.
User avatar
Teppic
Private First Class
Private First Class
Posts: 576
Joined: Mon Mar 07, 2005 10:00 pm
Location: The North Block

Post by Teppic »

Assuming linux:

Code: Select all

while true;do OUT1=$(date +%d-%m-%y@%X);bzadmin time@teppic.homelinux.net:5154 $OUT1 /quit;sleep 600;done
will put a 10 minute timestamp in the log.
User avatar
[dmp]
Captain
Captain
Posts: 282
Joined: Mon Dec 09, 2002 3:20 pm
Location: CPH, Denmark
Contact:

perl

Post by [dmp] »

Code: Select all

bzadmin user@server:port | perl -pne '($s,$m,$h,$D,$M,$Y,,,,) = localtime(); printf "%4d-%02d-%02d %02d:%02d:%02d ", $Y+1900,$M+1,$D,$h,$m,$s';
Or perhaps use logger to feed it to syslog
I don't need huge pictures here.
User avatar
Pimpinella
Private First Class
Private First Class
Posts: 96
Joined: Wed Nov 19, 2003 4:50 pm
Location: Jever, NDS, Germany

Re: perl

Post by Pimpinella »

meacan wrote:

Code: Select all

bzadmin user@server:port | perl -pne '($s,$m,$h,$D,$M,$Y,,,,) = localtime(); printf "%4d-%02d-%02d %02d:%02d:%02d ", $Y+1900,$M+1,$D,$h,$m,$s';
Or perhaps use logger to feed it to syslog
you might have to call bzadmin like "bzadmin -ui stdout user@server:port" though
Post Reply