Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grep 2 lines from tail -f output

Status
Not open for further replies.

TSch

Technical User
Jul 12, 2001
557
DE
Hi folks,

I'd like to monitor a continously growing logfile.

Each new entry of the logfile consists of about 5 lines.

Problem is I need only 2 lines of the output of each new logifle entry (e.g.):

File: ...
Status: ...

I don't need the other lines.

If I do something like that:

tail -f logfile | grep Status

I only get 1 line.

Is there any way to also get the second line ?

Thanks in advance !

Regards
Thomas
 
Perhaps tail -f | egrep 'File|Status'

I want to be good, is that not enough?
 
Great !!!
That's exactly what I needed.

Thanks a lot !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top