[ale] SHELL: log files monitoring

Danny Cox danscox at mindspring.com
Thu Feb 14 14:35:23 EST 2002


Andy,

On Thu, 2002-02-14 at 11:45, Zyman, Andy wrote:
> Hello.
> Happy Valentines Day folks :)

	And to you too.

> I have simple task : I need to monitor a log files for particular string.
> 
> for this purpose I made QD script which is doing basically this:
> 
> for i in $* ; do
>  tail -f | while read line
> 	case $line
> 	    <word i'm looking for>)   send email ;;
>  	esac
>  done &
> done

	Why not use grep?  It will almost certainly be faster than the above.

	More broadly, what are you trying to accomplish?  Is there a need, for
example, to not see dups?  Is that the reason 'tail' is used?

-- 
kernel, n.: A part of an operating system that preserves the
medieval traditions of sorcery and black art.

Danny


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list