Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-27-2011, 01:42 PM   #16
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 227Reputation: 227Reputation: 227

Two more alternatives for the multiline matching. I found them here and adapted them to your case:

pcregrep -M '.*May 5.*Print job request.*\n.*Installed|Failed' /var/log/updates.log
The program pcregrep comes with package pcre-8.12-i486-1, which is a stock Slackware package.

This one works as well, using awk:

cat /var/log/updates.log | awk '/May 5.*Print job request/,/Installed|Failed/'
Hope that helps!

Last edited by Diantre; 06-27-2011 at 01:45 PM. Reason: Some improvements to the regular expressions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto tail -f /var/log/messages | grep isdninfo Mopp Programming 4 07-22-2011 10:00 AM
kernel log format in /var/log/kern.log sinu_nayak2001 Linux - Newbie 2 10-07-2009 08:34 AM
How can I grep/sed the ips only from /var/log/messages? abefroman Programming 1 07-31-2009 01:47 PM
/var/log/messages and /var/log/cron not working sigkill Linux - Software 6 08-09-2008 01:08 PM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration