<?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: How to calculate average and percentage for fields with only names? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372393#M109528</link>
    <description>&lt;P&gt;Can you try this please:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;| stats count by name | eventstats sum(count)  as tot | eval pers=round(100*count/tot,2).%
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For avg you want calcul the avg by what?&lt;/P&gt;</description>
    <pubDate>Tue, 01 May 2018 08:47:28 GMT</pubDate>
    <dc:creator>TISKAR</dc:creator>
    <dc:date>2018-05-01T08:47:28Z</dc:date>
    <item>
      <title>How to calculate average and percentage for fields with only names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372391#M109526</link>
      <description>&lt;P&gt;Good Day splunkers. I have a query where i want to calculate the number of times a name came on the field, the average times the name was used and the percentage of the name in the field. (The below is truncated for understanding)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunkd 12,786  1.1%    
Apache#1    12,094  1.041%  
splunk-perfmon  11,788  1.015%  
java#3  11,684  1.006%  
rotatelogs  11,452  0.986%  
svchost#4   11,409  0.982%  
perl    11,078  0.954%  
emagent 10,821  0.931%  
Tomcat7 10,309  0.887%  
splunk-regmon   10,274  0.884%  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the field values were numeric I could have counted and summed and created the avg. but when the field value names like above how do I go forward? I have done something similar once with eval but I can't seem to figure this out.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 06:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372391#M109526</guid>
      <dc:creator>ranjitbrhm1</dc:creator>
      <dc:date>2018-05-01T06:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average and percentage for fields with only names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372392#M109527</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...your search here...
| eventstats count as namecount by name
| eventstats count as totalcount
| eval percentage=(namecount/totalcount)*100
| fieldformat percentage=percentage."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 08:03:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372392#M109527</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-01T08:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average and percentage for fields with only names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372393#M109528</link>
      <description>&lt;P&gt;Can you try this please:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;| stats count by name | eventstats sum(count)  as tot | eval pers=round(100*count/tot,2).%
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For avg you want calcul the avg by what?&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 08:47:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372393#M109528</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-05-01T08:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average and percentage for fields with only names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372394#M109529</link>
      <description>&lt;P&gt;How to find out count and average of a text based field for every 1 minute of time span&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 07:34:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-average-and-percentage-for-fields-with-only/m-p/372394#M109529</guid>
      <dc:creator>akarivaratharaj</dc:creator>
      <dc:date>2018-06-28T07:34:50Z</dc:date>
    </item>
  </channel>
</rss>

