title: How to "tail" the modsecurity logfile until a certain timestamp?
body: <p>I have a modsecurity logfile where I want to get the last events until a certain timestamp.
  A short introduction in how modsecurity logfiles are assembled:
  for example, 1 event is presented like:</p>
  
  <pre><code>--8b014015-A--
  [16/Mar/2016:20:13:02 +0100]
  ...omitted... 
  --8b014015-B--
  ...omitted... 
  --8b014015-F--
  ...omitted... 
  --8b014015-H--
  ...omitted... 
  --8b014015-Z--
  </code></pre>
  
  <p>A full example can be found here <a href="http://pastebin.com/M1iqnY6L" rel="nofollow">http://pastebin.com/M1iqnY6L</a></p>
  
  <p>I was thinking to combine tail and grep. </p>
  
  <ol>
  <li>grep to find the line of the timestamp (lets call this line <em>timestampLine</em>)</li>
  <li><em>tailLines</em> = (total lines in the file) - (<em>timestampLine</em> + 1)<br>
  //+ 1 because a request has the first line with <code>--id-A--</code> and second line the timestamp</li>
  <li>tail -n $<em>tailLines</em> logfile.log</li>
  </ol>
  
  <p>Is there a better way? If not, how do I grep this timestamp and get the line-number from step 1?</p>