<?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 AddColTotals &amp; Percentage Column in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60721#M14924</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;

&lt;P&gt;I have an existing table that includes several columns filled with numeric values and one column that creates percentage based off several of the existing columns. When adding in addcoltotals at the end of the statement, it adds the numeric columns correctly, but it adds all the percentage column values together.&lt;/P&gt;

&lt;P&gt;Is there a way to have that addcoltotals percentage column be an average percentage total instead of an overall sum of all percentage?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2013 16:18:18 GMT</pubDate>
    <dc:creator>behymejt2012</dc:creator>
    <dc:date>2013-09-11T16:18:18Z</dc:date>
    <item>
      <title>AddColTotals &amp; Percentage Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60721#M14924</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;

&lt;P&gt;I have an existing table that includes several columns filled with numeric values and one column that creates percentage based off several of the existing columns. When adding in addcoltotals at the end of the statement, it adds the numeric columns correctly, but it adds all the percentage column values together.&lt;/P&gt;

&lt;P&gt;Is there a way to have that addcoltotals percentage column be an average percentage total instead of an overall sum of all percentage?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 16:18:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60721#M14924</guid>
      <dc:creator>behymejt2012</dc:creator>
      <dc:date>2013-09-11T16:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: AddColTotals &amp; Percentage Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60722#M14925</link>
      <description>&lt;P&gt;You can't do that with addcoltotals. However, you can do something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| addcoltotals field1 field2 field3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where &lt;CODE&gt;field1 field2 field3&lt;/CODE&gt; is a list of the fields that you want to total.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 18:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60722#M14925</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-09-11T18:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: AddColTotals &amp; Percentage Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60723#M14926</link>
      <description>&lt;P&gt;Figured it out, I had the same problem.&lt;BR /&gt;
Add all the columns EXCEPT for the percentage column.&lt;BR /&gt;
You should now have all totals except for the percentage column.&lt;BR /&gt;
Do an eval looking for the null percentage column and calculate the percentage.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   ... | yoursearch | addcoltotals twomonth_job_failures twomonth_job_runs labelfield="myfield" | eval OneMonthPercentage=if(isnull(OneMonthPercentage), round((twomonth_job_failures/twomonth_job_runs)*100,2) , OneMonthPercentage)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 May 2014 13:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60723#M14926</guid>
      <dc:creator>Kyle_Jackson</dc:creator>
      <dc:date>2014-05-21T13:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: AddColTotals &amp; Percentage Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60724#M14927</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;
Is there a way that I can divide the values from field1 by the column total of field1 and display in a new field4? thank you&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 03:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60724#M14927</guid>
      <dc:creator>demkic</dc:creator>
      <dc:date>2016-11-28T03:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: AddColTotals &amp; Percentage Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60725#M14928</link>
      <description>&lt;P&gt;Hi behymejt2012,&lt;BR /&gt;
using addcoltotals command you can specify the field list that you want to summarize  &lt;/P&gt;

&lt;P&gt;see the example in Splunk Documentation page &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Addcoltotals"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Addcoltotals&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_* | table userId bytes avgTime duration | addcoltotals bytes duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 09:02:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddColTotals-Percentage-Column/m-p/60725#M14928</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-28T09:02:07Z</dc:date>
    </item>
  </channel>
</rss>

