From owner-freebsd-questions@FreeBSD.ORG Wed Apr 22 20:41:27 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 CA6821065687 for ; Wed, 22 Apr 2009 20:41:27 +0000 (UTC) (envelope-from evuraan@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.225]) by mx1.freebsd.org (Postfix) with ESMTP id 9D43F8FC17 for ; Wed, 22 Apr 2009 20:41:27 +0000 (UTC) (envelope-from evuraan@gmail.com) Received: by rv-out-0506.google.com with SMTP id k40so145884rvb.43 for ; Wed, 22 Apr 2009 13:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=z12coNKt9f+CBkprSYFSEN5GN7b2nbhYLERkok+9ino=; b=bkvJtdn2gAhlaWmrjpD7BF4aj+Y/hiEk5r4DyJ3FSNvGuTKmJzxBaAw09wgbG6r658 13C8T++gMIJCiy75z+XbaevtxY5SAnZYJYntDwzjjLSlkOSH/9Lf7IufebzaH5xEP4Rw WsPfxwZxV3XEZ9MQF/yuJYjoTu44Uaimk5qSs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=G7jaYkLLtK74SUAgi9qWW+ZEegxPLbz+NMZXJa32EzHOdnCs61dUt1WwAziAMKzhdM mR4CBHBxKjabGmMjk4sYCfVNWUpHYipE10WqtCuz3ElnLScj56XhtnGkMhE5f7uCOMNH d/BGXQ1cP2emtmAeRiGYmCElu5fdJeFiQXt3M= MIME-Version: 1.0 Received: by 10.141.51.2 with SMTP id d2mr51782rvk.157.1240432887172; Wed, 22 Apr 2009 13:41:27 -0700 (PDT) In-Reply-To: <20090422201407.GA9323@ayn.mi.celestial.com> References: <6fbcd0710904221238r1cb63d41qaa331beb683ffa95@mail.gmail.com> <20090422201407.GA9323@ayn.mi.celestial.com> Date: Wed, 22 Apr 2009 13:41:27 -0700 Message-ID: <6fbcd0710904221341l3ed60272rdbb41e4db123d822@mail.gmail.com> From: =?UTF-8?B?RXZ1cmFhbjo64LSP4LS14LWC4LSw4LS+4LSo4LWN4oCNIA==?= To: freebsd@celestial.com, freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: 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 List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2009 20:41:28 -0000 nevermind, i got it to work, with a little help from http://student.northpark.edu/pemente/awk/awk_sys.txt, tail -f /var/log/apache2/access.log | awk '/192.168.1.100/ {system("echo " $0 "| mailx -s test_email me@email.com" ) }' thx..! 2009/4/22 Bill Campbell : > 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::???????????????????????? =C2=A0wrote: >>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/ { =C2=A0print >>$0 | "mail me@email.address =C2=A0"}' >> >>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.o= rg" >> > > -- > Bill > -- > INTERNET: =C2=A0 bill@celestial.com =C2=A0Bill Campbell; Celestial Softwa= re LLC > URL: http://www.celestial.com/ =C2=A0PO Box 820; 6641 E. Mercer Way > Voice: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(206) 236-1676 =C2=A0Mercer Isla= nd, WA 98040-0820 > Fax: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(206) 232-9186 =C2=A0Skype:= 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 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >