Re: log wiever

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Do, den 12.02.2004 schrieb Tommy Reynolds um 21:37:
> Uttered Alexander Dalloz <alexander.dalloz@xxxxxxxxxxxxxxxx>, spake thus:
> 
> > Hey! You and Douglas are right. :) 
> 
> I don't mind people saying that I'm right, as long as they don't
> sound surprized ;-)
> 
> > fiddled with that I not only wanted to combine tail -f with grep but to
> > let this run unattended and let the output redirect into a separate log
> > file. Something like:
> > 
> > tail -f $LOGFILE | grep "$EXPRESSION" >> $GREPPED.LOGFILE
> > 
> > This does not work. Or do you know a solution for that? I know there are
> > tools available for this task, to react on defined log events.
> 
> How do you mean "doesn't work"?  There's nothing broken here; that
> command line should be fine.
> 
> Hmmm... what shell do you use?

I am a bash guy.

I played again with tail -f and grepping to a file. Now I had success
following your hint using --line-buffered. The specific command I used
now is:

tail -f /var/log/fetchmail.log | grep --line-buffered
"adalloz@xxxxxxxxxxxxxxxxxxxxx" >> fetch.log

which leads to log entries in fetch.log like:

fetchmail: reading message adalloz@xxxxxxxxxxxxxxxxxxxxx:1 of 5 (4749
header octets)
fetchmail: reading message adalloz@xxxxxxxxxxxxxxxxxxxxx:2 of 5 (3666
header octets)
...

Fine, fine. Sorry for my previous "does not work". I should have known
better to state a meaningful description. Before I always found a
touched but empty file to which I wanted to redirect the grepped output
of tail -f.

Thanks, I did learn from that.

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG key 1024D/ED695653 1999-07-13
Fedora GNU/Linux Core 1 (Yarrow) on Athlon CPU kernel 2.4.22-1.2149.nptl
Sirendipity 01:04:22 up 4 days, 3:46, load average: 0.13, 0.19, 0.17 
                   [ ÎÎÏÎÎ Ï'ÎÏÏÎÎ - gnothi seauton ]





[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux