Re: [Nolug] Combining Grep and tail -f

From: Scott Harney <scotth_at_scottharney.com>
Date: Sun, 04 Jul 2004 12:59:16 -0500
Message-ID: <40E84574.9070906@scottharney.com>

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.

something wrong with your pattern maybe. I do this all the time.
Alternatively:
tail -f /var/log/httpd/access_log | egrep -v "ignorepattern1|ignorepattern2"

-- 
Scott Harney<scotth@scottharney.com>
"Asking the wrong questions is the leading cause of wrong answers"
gpg key fingerprint=7125 0BD3 8EC4 08D7 321D CEE9 F024 7DA6 0BC7 94E5
___________________
Nolug mailing list
nolug@nolug.org
Received on 07/04/04

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