bb-hist.sh strange problem

Werner Michels (Ext Lists) wmlist_ext at terra.com.br
Thu Apr 14 14:48:11 CEST 2005


On Thu, 14 Apr 2005 10:09:25 +0200
Thomas Ruecker <truecker at technologie-management.net> wrote:

> >>The first log-entry is invalid - there's no duration field on it.
> >>If you change it to
> >>
> >>   Fri Jan 14 15:06:36 2005 green  1105711596 6998156
> >>
> >>does that fix the history display ? (The 6998156 is simply 
> >>the difference between th Jan 14 timestamp and the Apr 5 
> >>16:02 timestamp).
> > 
> > I will try it tomorrow, because I'm out of office today and give you some
> > feedback.
> I deleted the line without the duration and now it works. But I don't 
> have an idea, how to do this with a script on all logfiles. Anyone with 
> an short-script, that deletes a line file where are only 3 columns and 
> not 4?
> 
	
Thomas,

	There're probably hundreds of ways to do it. 
	With egrep on command line or in a shell script it could be done by:


  egrep "200[0-5][[:space:]]+[a-z]+[[:space:]]+[0-9]+[[:space:]]+[0-9]+[[:space:]]?+$" log_file  >new_logfile

	You can be less stricter, matching only "<number><space?s><number>", or use sed, awk...

	Hope it help's.

-wm




More information about the Xymon mailing list