title: Amazon Cloudwatch Logs Insights parse with regex
body: <p>I'm trying to extract an ephemeral field with the <code>parse</code> command. Unfortunately, the log format is such that the glob expression is not enough for it, thus I need to use regex. The regex itself is fine, but I just can't make the command to extract anything. </p>
  
  <p>I'm trying with:</p>
  
  <pre><code>parse @endpoint /^([a-zA-Z_]+)[\/|?]*.*/ as @clean_endpoint
  </code></pre>
  
  <p>The first group is what I'm after here and I did try with different kinds of quotes etc. It might be just a stupid formatting error, but I just cant' find it.</p>
  
  <p>Pretty much the only documentation mentioning the <code>parse</code> command is <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html" rel="noreferrer">here</a> and the example there is using the glob expressions. Couldn't find any examples by googling either. </p>
  
  <p>So anyone bumped into this and solved it?  </p>