<?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: Calculate Average in same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531122#M150041</link>
    <description>&lt;P&gt;Thanks!. It works. Same way, I have to leave the first 2 max values and do the same for others. What should I do.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2020 09:23:54 GMT</pubDate>
    <dc:creator>nivethainspire_</dc:creator>
    <dc:date>2020-11-27T09:23:54Z</dc:date>
    <item>
      <title>Calculate Average in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531099#M150031</link>
      <description>&lt;P&gt;I like to take sum the "count" where&amp;nbsp; "Core Content" field's first 2&amp;nbsp; max values, Finally divide them by total count.&lt;/P&gt;&lt;P&gt;For Example,&lt;/P&gt;&lt;TABLE width="332"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Core Content&lt;/TD&gt;&lt;TD&gt;Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4268&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;2223&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4267&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;1794&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4266&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;305&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4265&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4264&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4263&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;63&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4262&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;133&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="25px"&gt;4261&lt;/TD&gt;&lt;TD width="187px" height="25px"&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="40px"&gt;4260&lt;/TD&gt;&lt;TD width="187px" height="40px"&gt;&lt;P&gt;26&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="144px" height="40px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="187px" height="40px"&gt;&lt;P&gt;4768&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this table, I want the below calculation to be implemented using Eval.&lt;/P&gt;&lt;P&gt;(2223+1794) / 4768, where 2223 - 1st max value of core content, 1794 - 2nd max value of core content , 4768 - total count.&lt;/P&gt;&lt;P&gt;How to calculate this using eval.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 06:40:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531099#M150031</guid>
      <dc:creator>nivethainspire_</dc:creator>
      <dc:date>2020-11-27T06:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531102#M150032</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/122614"&gt;@nivethainspire_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want to display values and percentage of the first two values?&lt;/P&gt;&lt;P&gt;if yes, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search
| stats count AS Count BY "Core Content"
| sort -Count 
| head 2 
| eventstats sum(Count) AS total 
| eval perc=round(Count/total*100,2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 07:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531102#M150032</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-11-27T07:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531108#M150036</link>
      <description>&lt;LI-CODE lang="markup"&gt;your_search
| stats count AS Count BY "Core Content"
| eventstats sum(Count) AS total 
| eval Count=Count/total
| sort - Count 
| head 2 &lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 27 Nov 2020 08:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531108#M150036</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-27T08:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531110#M150038</link>
      <description>&lt;P&gt;if instead you want two values but the percentage respect all the values, you could use the top command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search
| top 2 "Core Content"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 08:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531110#M150038</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-11-27T08:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531122#M150041</link>
      <description>&lt;P&gt;Thanks!. It works. Same way, I have to leave the first 2 max values and do the same for others. What should I do.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 09:23:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531122#M150041</guid>
      <dc:creator>nivethainspire_</dc:creator>
      <dc:date>2020-11-27T09:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531123#M150042</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/122614"&gt;@nivethainspire_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S. Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 09:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531123#M150042</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-11-27T09:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531125#M150043</link>
      <description>&lt;P&gt;I want to leave the top 2 and sum up others&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 10:26:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-Average-in-same-field/m-p/531125#M150043</guid>
      <dc:creator>nivethainspire_</dc:creator>
      <dc:date>2020-11-27T10:26:46Z</dc:date>
    </item>
  </channel>
</rss>

