Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2009 13:41:27 -0700
From:      =?UTF-8?B?RXZ1cmFhbjo64LSP4LS14LWC4LSw4LS+4LSo4LWN4oCNIA==?= <evuraan@gmail.com>
To:        freebsd@celestial.com, freebsd-questions@freebsd.org
Subject:   Re: awk question (actively tail a file & notify when expression is  found)
Message-ID:  <6fbcd0710904221341l3ed60272rdbb41e4db123d822@mail.gmail.com>
In-Reply-To: <20090422201407.GA9323@ayn.mi.celestial.com>
References:  <6fbcd0710904221238r1cb63d41qaa331beb683ffa95@mail.gmail.com> <20090422201407.GA9323@ayn.mi.celestial.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <freebsd@celestial.com>:
> 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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6fbcd0710904221341l3ed60272rdbb41e4db123d822>