Xymon Mailing List Archive search

bb-hist.sh strange problem

list Werner Michels
Thu, 14 Apr 2005 09:48:11 -0300
Message-Id: <user-910f28ce49e8@xymon.invalid>

On Thu, 14 Apr 2005 10:09:25 +0200
Thomas Ruecker <user-3b9c05d5aa4b@xymon.invalid> 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