title: How to grep a log file content within a particular timestamp range in Linux?
body: <p>I have a log file, which has data in the following format</p>
  
  <pre><code>[1361991081] SERVICE NOTIFICATION: qreda;qa-hadoop1;CPU Load;CRITICAL;notify-service-by-email;CRITICAL - load average: 18.29, 18.14, 18.10
  [1361991371] SERVICE NOTIFICATION: qreda;CRITICAL-SERVICES_FOR_LAST_24_HOURS;qa-hadoop1:Critical Services;CRITICAL;notify-service-by-email;CPU Load,Memory,
  [1361994681] SERVICE NOTIFICATION: qreda;qa-hadoop1;CPU Load;CRITICAL;notify-service-by-email;CRITICAL - load average: 18.02, 18.06, 18.11
  [1361994971] SERVICE NOTIFICATION: qreda;CRITICAL-SERVICES_FOR_LAST_24_HOURS;qa-hadoop1:Critical Services;CRITICAL;notify-service-by-email;CPU Load,Memory,
  </code></pre>
  
  <p>I contains all the data for the past 7 days.I want to grep this file to show the logs for yesterday. Here date is showing as timestamp. I am using the following command</p>
  
  <pre><code>cat /usr/local/nagios/var/nagios.log |grep qa-hadoop1|grep CRITICAL|grep NOTIFICATION | awk -F, '{ if ($1&gt;"[1361989800]" &amp;&amp; $1&lt;"[1362076199]") print }'
  </code></pre>
  
  <p>where <code>1361989800</code> is the calculated timestamp value for <code>Thu Feb 28 00:00:00 IST 2013</code></p>
  
  <p>and  <code>1362076199</code> is the calculated timestamp value for <code>Thu Feb 28 23:59:59 IST 2013</code>.</p>
  
  <p>This works well but the problem is how do i pass <code>1361989800</code> and <code>1362076199</code> as arguments??</p>