title: Shell Script to get exception from logs for last one hour
body: <p>I am developing script which will grep logs of last one hour and check any exception and send email for solaris platform.</p>
  
  <p>I did following steps</p>
  
  <pre><code>grep -n -h date +'%Y-%m-%d %H:%M' test.logs
  </code></pre>
  
  <p>above command gives me line number and then i do following</p>
  
  <pre><code>tail +6183313 test.log | grep 'exception'
  </code></pre>
  
  <p>sample logs</p>
  
  <pre><code>2014-02-17 10:15:02,625 | WARN  | m://mEndpoint | oSccMod | 262 - com.sm.sp-client - 0.0.0.R2D03-SNAPSHOT | 1201 or 101 is returned as exception code from SP, but it is ignored
  2014-02-17 10:15:02,625 | WARN  | m://mEndpoint | oSccMod | 262 - com.sm.sp-client - 0.0.0.R2D03-SNAPSHOT | SP error ignored and mock success returned
  2014-02-17 10:15:02,626 | INFO  | 354466740-102951 | ServiceFulfill | 183 - org.apache.cxf | Outbound Message
  </code></pre>
  
  <p>Please suggest any better alternative to perform above task.</p>