<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Stats count and average in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-count-and-average/m-p/110214#M28799</link>
    <description>&lt;P&gt;Solved it perfectly. Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2015 04:12:51 GMT</pubDate>
    <dc:creator>rhinomike</dc:creator>
    <dc:date>2015-03-02T04:12:51Z</dc:date>
    <item>
      <title>Stats count and average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-count-and-average/m-p/110212#M28797</link>
      <description>&lt;P&gt;I have a log that more or less looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; timestamp=1422006650  from=bob@sender.com to=alice@receiver.com subject="I love you honey" score=100 
 timestamp=1422007650    from=bob@sender.com to=alice@receiver.com subject="I love you honey" score=100 
 timestamp=1422008650    from=eve@sender.com to=alice@receiver.com subject="I loved him first" score=100
 timestamp=1422009650    from=eve@sender.com to=alice@receiver.com subject="I loved you first" score=50
 timestamp=1422009750    from=eve@sender.com to=alice@receiver.com subject="I loved him  first" score=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am now trying to perform a stats like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;from                    subject                 count_to    avg_score
bob@sender.com          I love you honey       2       100
eve@sender.com          I loved you first      1       50
eve@sender.com          I loved him first      2       55
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I'm not mistaken, I can use:&lt;/P&gt;

&lt;P&gt;stats count by from,to, subject to build the four first columns, however it is not clear to me how to calculate the average for a particular set of values in accordance with the first round of stats.&lt;/P&gt;

&lt;P&gt;Is it possible?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2015 10:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-count-and-average/m-p/110212#M28797</guid>
      <dc:creator>rhinomike</dc:creator>
      <dc:date>2015-01-23T10:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Stats count and average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-count-and-average/m-p/110213#M28798</link>
      <description>&lt;P&gt;This should work:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | stats count as count_to avg(score) as avg_score by from subject&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2015 15:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-count-and-average/m-p/110213#M28798</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-01-23T15:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Stats count and average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-count-and-average/m-p/110214#M28799</link>
      <description>&lt;P&gt;Solved it perfectly. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2015 04:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-count-and-average/m-p/110214#M28799</guid>
      <dc:creator>rhinomike</dc:creator>
      <dc:date>2015-03-02T04:12:51Z</dc:date>
    </item>
  </channel>
</rss>

