From owner-freebsd-questions Tue Jul 17 16:25:46 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mtiwmhc26.worldnet.att.net (mtiwmhc26.worldnet.att.net [204.127.131.51]) by hub.freebsd.org (Postfix) with ESMTP id 0D42E37B403 for ; Tue, 17 Jul 2001 16:25:43 -0700 (PDT) (envelope-from parv@worldnet.att.net) Received: from worldnet.att.net ([32.101.235.181]) by mtiwmhc26.worldnet.att.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010717232541.GEBG2154.mtiwmhc26.worldnet.att.net@worldnet.att.net> for ; Tue, 17 Jul 2001 23:25:41 +0000 Received: by worldnet.att.net (Postfix, from userid 1001) id 7E74550D76; Tue, 17 Jul 2001 19:29:29 -0400 (EDT) Date: Tue, 17 Jul 2001 19:29:28 -0400 From: parv To: f-q Subject: need suggestions to filter make logs Message-ID: <20010717192928.A38890@moo.holy.cow> Mail-Followup-To: f-q Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi, following is the regex (in perl) that i have came up w/ so far to filter large make logs, like (build|install)(world|kernel). does anybody have suggestions for other "interesting" regexes? ------- filter-log .perl -------- #!/usr/bin/perl -w use strict; # line-wise buffering $|=1; while (<>) { # print "status" & errors+warnings, but not compiler lines print if (m#[-=>]{3,}|\b(?:warning:|error|stop)#i && ! m#^cc.+#i); # print 'time' statistics print if m#(?:real|user|sys)\s+\d+m\d+\.\d{3}s# } ---------------------------- i use it like this... # cd /source/src && (make buildworld )>& /log/some/where & # # tail -f /log/some/where | filter-log ideally i would have done this, tail included... ------- filter-log .sh -------- #!/bin/sh if (test -f $1 -a -r $1) then tail -f | egrep -i '\-\-\-|===|warning:|error|stop|real.*m.s' | grep -v '^cc ' fi ---------------------------- ...but due to buffering, 2d grep would result in no output; otherwise i would have to sacrifice the 2d grep... any suggestions? -- so, do you like word games or scrabble? - parv To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message