title: How do I combine 2 search metrics with math expression in cloudwatch?
body: <p>I am trying to get the percentage memory used when running a lambda to display in a graph on cloudwatch. I know there are other ways I can pull the data, but for reasons outside of the scope of this question, I would like to stick to using search to pull the metrics.</p>
  <p>I have the following graph</p>
  <pre><code>{
      &quot;metrics&quot;: [
          [ { &quot;expression&quot;: &quot;SEARCH('{SomeMetricNamespace} MetricName=\&quot;MemorySize\&quot;', 'Average', 300)&quot;, &quot;id&quot;: &quot;m1&quot;, &quot;visible&quot;: &quot;true&quot; } ],
          [ { &quot;expression&quot;: &quot;SEARCH('{SomeMetricNamespace} MetricName=\&quot;MaxMemoryUsed\&quot;', 'Average', 300)&quot;, &quot;id&quot;: &quot;m2&quot;, &quot;visible&quot;: &quot;true&quot; } ],
          [ { &quot;expression&quot;: &quot;m2/m1*100&quot;, &quot;label&quot;: &quot;pecentage memory used&quot;, &quot;id&quot;: &quot;e1&quot;, &quot;stat&quot;: &quot;Average&quot; } ]
      ],
      &quot;view&quot;: &quot;timeSeries&quot;,
      &quot;stacked&quot;: false,
      &quot;region&quot;: &quot;us-west-2&quot;,
      &quot;stat&quot;: &quot;Average&quot;,
      &quot;period&quot;: 300,
      &quot;title&quot;: &quot;Memory&quot;,
      &quot;yAxis&quot;: {
          &quot;left&quot;: {
              &quot;label&quot;: &quot;Percentage Usage&quot;,
              &quot;showUnits&quot;: false
          }
      },
      &quot;liveData&quot;: false
  }
  </code></pre>
  <p>The error I am getting</p>
  <pre><code>Error in expression e1 [Unsupported operand type(s) for /: '[Array[TimeSeries], Array[TimeSeries]]']
  </code></pre>
  <p>Is there a way to combine the first 2 expressions to give me the percentage memory used?</p>