title: CloudWatch Logs Insights Parse Syntax
body: <p>I have a Lambda which queries the ec2 api and prints output to cloudwatch logs, which I want to use for metrics. However, I'm having trouble parsing the output (generated from a dictionary). Here is a typical @message:</p>
  
  <p><code>defaultdict(None, {ec2.Instance(id='i-instance'): {'InstanceID': 'i-instance', 'Type': 't2.micro', 'ImageID': 'ami-0e5493310d2c6de5b', 'State': 'running'</code></p>
  
  <p>I tried to <code>|parse 'InstanceID': *' as InstanceId</code> and similar but this errors, and I haven't found examples in the documentation (<a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html</a>). </p>
  
  <p>Assistance appreciated.</p>