title: CloudWatch Logs Insights get average of count returned
body: <p>I'm querying CloudWatch logs via Logs Insights queries and am trying to get the average for count returned. For example, my current query that gets the counts is (only relevant parts shown):</p>
  <pre><code>fields fieldA as A
  | stats count(*) as countForEachA by A
  </code></pre>
  <p>returns this:</p>
  <pre><code>  A    countForEachA
  ______ _____________
  a123      22
  a124      22
  a125      16
  </code></pre>
  <p>I'm trying to get the average for field <code>countForEachA</code>. Therefore, for the example above, I want the average: 20 (sum of countForEachA divided by total results). Here's what I've tried:</p>
  <pre><code>fields fieldA as A
  | stats avg(count(*)) as average by A
  </code></pre>
  <p>The query above returns this:</p>
  <pre><code>  A    countForEachA
  ______ _____________
  a123      2.3
  a124      1.4
  a125      2.9
  </code></pre>
  <p>while I expected a single answer representing the average. Any help will be appreciated.</p>