From owner-freebsd-questions@FreeBSD.ORG Wed Apr 22 20:35:01 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7EED106566B for ; Wed, 22 Apr 2009 20:35:01 +0000 (UTC) (envelope-from bill@mi.celestial.com) Received: from dorsai-02.celestial.com (dorsai-02.celestial.com [192.136.111.19]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBD88FC0A for ; Wed, 22 Apr 2009 20:35:00 +0000 (UTC) (envelope-from bill@mi.celestial.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by dorsai-02.celestial.com (Postfix) with ESMTP id 5F5E52059DA2 for ; Wed, 22 Apr 2009 13:14:08 -0700 (PDT) X-Virus-Scanned: amavisd-new at celestial.com Received: from dorsai-02.celestial.com ([127.0.0.1]) by localhost (dorsai-02.celestial.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id PRypyxG0DQ99 for ; Wed, 22 Apr 2009 13:14:08 -0700 (PDT) Received: from ayn.mi.celestial.com (hayek.celestial.com [192.136.111.12]) by dorsai-02.celestial.com (Postfix) with ESMTP id 302C12059D93 for ; Wed, 22 Apr 2009 13:14:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ayn.mi.celestial.com (Postfix) with ESMTP id 01BF768DEF699; Wed, 22 Apr 2009 13:14:08 -0700 (PDT) X-Virus-Scanned: amavisd-new at mi.celestial.com Received: from ayn.mi.celestial.com ([127.0.0.1]) by localhost (ayn.mi.celestial.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id a4IsekyC58sF; Wed, 22 Apr 2009 13:14:07 -0700 (PDT) Received: by ayn.mi.celestial.com (Postfix, from userid 203) id D813F68BBC5F9; Wed, 22 Apr 2009 13:14:07 -0700 (PDT) Date: Wed, 22 Apr 2009 13:14:07 -0700 From: Bill Campbell To: freebsd-questions@freebsd.org Message-ID: <20090422201407.GA9323@ayn.mi.celestial.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <6fbcd0710904221238r1cb63d41qaa331beb683ffa95@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6fbcd0710904221238r1cb63d41qaa331beb683ffa95@mail.gmail.com> User-Agent: Mutt/1.5.19 OpenPKG/% (2009-01-05) Subject: Re: awk question (actively tail a file & notify when expression is found) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd@celestial.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2009 20:35:02 -0000 You might want to look at ``swatch'' which is designed to do this, and monitors multiple log files simultaneously. On Wed, Apr 22, 2009, Evuraan::???????????????????????? wrote: >Greetings..! > >this works, > >tail -f /var/log/apache2/access.log | nawk '/192.168.1.100/{ print $0 }' > >and this too: > > tail -f /var/log/apache2/access.log |awk ' /192.168.1.100/ { system >("mail -s \"This works\" me@email.address")}' > >but this below, does not work > > tail -f /var/log/apache2/access.log |awk ' /192.168.1.100/ { print >$0 | "mail me@email.address "}' > >Any pointers would be much appreciated. > >Thx. >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- Bill -- INTERNET: bill@celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 Skype: jwccsllc (206) 855-5792 Capitalism works primarily because most of the ways that a company can be scum end up being extremely bad for business when there's working competition. -rra