<?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 the sum of values from a chart and create a field specifying that total of those values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90314#M23204</link>
    <description>&lt;P&gt;Hmm.. The timechart is the way which i am doing as of now. But I am trying to see if I can actually use multiple visualizations on a single dashboard. Like a bar chart mentioning the total count of incidents and then a line chart upon the bar chart which graphs according to number of incidents and the priority of the incident.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2012 15:51:50 GMT</pubDate>
    <dc:creator>theouhuios</dc:creator>
    <dc:date>2012-10-15T15:51:50Z</dc:date>
    <item>
      <title>How to Calculate the sum of values from a chart and create a field specifying that total of those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90310#M23200</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I am trying to create a total of values in different fields and add it to the output as a different field. I am able to get the value of different fields but got stuck on how to add them.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="xxxx" earliest=-31d@d latest=@d| dedup record.incidentId   |stats count by record.priority| 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the command which I used to get the data. The data now is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;record.priority     count
1                        6
2                    7568
3                    6346
4                    68
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I wanted to add another field with a total of all the count values in the same chart.&lt;/P&gt;

&lt;P&gt;Anyone has an idea on how to do that? Is there any other method where I can first get the whole total of the count in a bar chart for a 31 day period and then probably draw the graph with different priority fields which gives the information about each priority with a count of incidents created per day?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;-theou   &lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 14:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90310#M23200</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2012-10-15T14:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate the sum of values from a chart and create a field specifying that total of those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90311#M23201</link>
      <description>&lt;P&gt;You should probably look at the &lt;CODE&gt;addcoltotals&lt;/CODE&gt; command;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search_here | addcoltotals labelfield=record.priority label="Total count"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See the docs here: &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Addcoltotals"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Addcoltotals&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For the second part of your query, I don't really understand how you want the output, but try;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="xxxx" earliest=-31d@d latest=@d| dedup record.incidentId  | timechart span=1d count by record.priority
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can paste the search (or write a new one from scratch) into the Advanced Charting view (under the "Dashboards &amp;amp; Views" menu), and play around with the visualization options.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 15:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90311#M23201</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-15T15:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate the sum of values from a chart and create a field specifying that total of those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90312#M23202</link>
      <description>&lt;P&gt;that or &lt;CODE&gt;eventstats&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 15:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90312#M23202</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-10-15T15:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate the sum of values from a chart and create a field specifying that total of those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90313#M23203</link>
      <description>&lt;P&gt;true, &lt;CODE&gt;addcoltotals&lt;/CODE&gt; does not create a new field per se, but I gathered that the real request was more for presentation purposes.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 15:33:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90313#M23203</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-15T15:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate the sum of values from a chart and create a field specifying that total of those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90314#M23204</link>
      <description>&lt;P&gt;Hmm.. The timechart is the way which i am doing as of now. But I am trying to see if I can actually use multiple visualizations on a single dashboard. Like a bar chart mentioning the total count of incidents and then a line chart upon the bar chart which graphs according to number of incidents and the priority of the incident.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 15:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90314#M23204</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2012-10-15T15:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate the sum of values from a chart and create a field specifying that total of those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90315#M23205</link>
      <description>&lt;P&gt;Used the addtotals &lt;FIELDS&gt; command to get a total value. Then used fields to remove the redundant fields which weren't needed. &lt;/FIELDS&gt;&lt;/P&gt;

&lt;P&gt;Thanks for all your help.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 19:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Calculate-the-sum-of-values-from-a-chart-and-create-a/m-p/90315#M23205</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2012-10-15T19:04:49Z</dc:date>
    </item>
  </channel>
</rss>

