title: aws cloudwatch logs filter pattern include lines before and/or after matching pattern
body: <p>Is there a way to include N lines before and/or after a matching pattern in AWS CloudWatch Logs? </p>
  
  <p>Let's say I have this query and would like 3 lines before and after each match.</p>
  
  <pre><code>aws logs filter-log-events --log-group-name my-group --filter-pattern "mypattern"
  </code></pre>
  
  <p>The only work around I have at the moment is to remove the filter pattern and use grep:</p>
  
  <pre><code>aws logs filter-log-events --log-group-name my-group | grep -A 3 -B 3 mypattern
  </code></pre>
  
  <p>However, I would like to only stream the log events I need and do it as part of the aws log events query.</p>