title: Select line below search expression in log file
body: <p>I am trying to search logs for an expression, then select the line below each match.</p>
  
  <h3>Example</h3>
  
  <p>I know I want the lines below CommonText, for example given the log data:</p>
  
  <pre><code>CommonTerm: something
  This Should
  random stuff
  CommonTerm: something else
  Be The
  random stuff
  more random stuff
  CommonTerm: something else
  Output Text
  random fluff
  </code></pre>
  
  <h3>Desired Output</h3>
  
  <pre><code>This Should
  Be The
  Output Text
  </code></pre>
  
  <h3>Current Attempt</h3>
  
  <p>Currently I can use <code>grep log_file CommonTerm -B 0 -A 1</code> to get:</p>
  
  <pre><code>CommonTerm: something
  This Should
  --
  CommonTerm: something else
  Be The
  --
  CommonTerm: something else
  Output Text
  </code></pre>
  
  <p>I can then pipe this through <code>| grep "\-\-" -B 0 -A 1</code> to get</p>
  
  <pre><code>This Should
  --
  --
  Be The
  --
  --
  Output Text
  --
  </code></pre>
  
  <p>And then through <code>awk '{if (count++%3==0) print $0;}'</code>, giving:</p>
  
  <pre><code>This Should
  Be The
  Output Text
  </code></pre>
  
  <p>My question is: surely there's a good 'unix-y' way to do this? Multi greps and a hacky awk feels pretty silly... Is there?</p>
  
  <p>Edit: I also tried:</p>
  
  <pre><code>(grep 'CommonTerm:' log_file -B 0 -A 2) | grep "\-\-" -B 1 -A 0 | grep -v "^--$"
  </code></pre>
  
  <p>but it seems much more clunky than the answers below which was expected ;)</p>
  
  <h2>Edit:</h2>
  
  <p>There are some great answers coming in, are there any which would let me easily select the <strong>nth</strong> line after the search term? I see a few might be more easy than others...</p>