The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-30-2007
Nysif Steve Nysif Steve is offline
Registered User
  
 

Join Date: Aug 2007
Location: Albany, NY
Posts: 26
Script lines of a Log Files

I am creating a script that will look through a log file and print the previous days entries. However I do not want the complete line of the entry.

A single line of the log file is as follows:

Aug 30 06:35:08 trnwvltfit1 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping

I am using the date of the line to determine which lines to print. However, I am only trying to print the parts of the line that are NOT highlighted in red. I have no knowledge of how long the line may be. How can this be done? So far I have:


Code:
$cat messages.log | grep "Aug 30" |

Thanks ahead of time.