Re: looking at alert log

From: Yong Huang <"Yong>
Date: Sat, 19 Nov 2016 20:14:12 +0000 (UTC)
Message-ID: <1970441569.385341.1479586452143_at_mail.yahoo.com>


tail -f will continually follow the file it reads and prints all the newly added lines to the screen or the pipe you specify. Why do you think grep won't capture what's pipe'd in from it? Some programs print to stderr and a simple "|" pipe just catching their stdout won't work (e.g. many command errors or their help or usage, such as impdp help=y). But tail -f sends output to stdout.

tail -f works by initially reading from the end of the file back to (by default) the 10th line counted backward. Every second, or every -s seconds for GNU version of tail, it checks the file again. There's no magic here.

Yong

Justin Munga wrote:

Won't tail -f just continually "follow" the alert log, and thus not pass anything on to grep?
On Fri, Nov 18, 2016 at 4:34 PM, Yong Huang <dmarc-noreply_at_freelists.org> wrote:

> Brian,
>
> Instead of reading the entire alert.log, which could grow big, why not
> read the tail?
>
> tail -f alert.log | grep pattern
>
> I have a fairly sophiscated example (called ck_alert_log.sh) at
> http://yong321.freeshell.org/computer/logfile.html

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Nov 19 2016 - 21:14:12 CET

Original text of this message