Re: [Nolug] Combining Grep and tail -f

From: James Scott <jhs_technical_at_cox.net>
Date: Sun, 04 Jul 2004 19:36:58 -0500
Message-Id: <1088987818.3003.2.camel@ip68-11-44-133.no.no.cox.net>

On Sun, 2004-07-04 at 13:04, Dave Cash wrote:
> On Sun, 4 Jul 2004, Petri Laihonen wrote:
>
> > Does anybody know how I could combine grep and tail -f.
> >
> > As you all probably know "tail -f /var/log/httpd/access_log" gives nice
> > realtime viev for what is happening with your website(s)
> >
> > However, how would one weed out all the extra lines when the information
> > from only one virtual host or specific file is needed?
> > For example 'tail -f /var/log/httpd/access_log | grep -i "mydomain.tld"',
> > would not give any results and if you reverse grep and tail, then only
> > tail is effective.
> >
> > Any suggestions?
>
> Petri,
>
> I'm not sure what you're hoping to accomplish, but if I read your
> question correctly, I think you've already solved your problem with
> the
>
> tail -f /var/log/httpd/access_log | grep -i "mydomain.tld"
>
> you included above. This will indeed produce a live, continually
> updated tail of the file, but only display matches to the grep
> pattern. I not sure what you means when you said it "would not give
> any results." I use that very combination of tools frequently and
> it always gives me exactly the output I expect.
>
> HTH,
>
> Dave
>
Looks right to me. I have fat fingered things like this before adding a
space in the wrong place or something but these were the only times this
did not work for me.
> /L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\
> Dave Cash Power to the People!
> Frolicking in Fields of Garlic Right On-Line!
> dave@gnofn.org Dig it all.
> ___________________
> Nolug mailing list
> nolug@nolug.org

___________________
Nolug mailing list
nolug@nolug.org
Received on 07/04/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST