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!