<?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 sum(field) depending on another field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210273#M61492</link>
    <description>&lt;P&gt;try like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|bucket _time span=1months| top  Type by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Feb 2016 13:00:19 GMT</pubDate>
    <dc:creator>fdi01</dc:creator>
    <dc:date>2016-02-22T13:00:19Z</dc:date>
    <item>
      <title>How to sum(field) depending on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210270#M61489</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I have a field called Type with three values and I want a chart of the percentage of these three values. I am looking for a chart like this, which is easy to achieve:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1066i628ACD4C7C08EAC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;But with the % value over the total count of another field for each type. I have a field called Count, that I want to sum for each type, so by now, my search is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart sum(Count) by Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The thing is that I cannot find a way to sum this field depending of the Type field. If I had the sum, I could calculate the percentage myself.&lt;/P&gt;

&lt;P&gt;Someone knows if I can do it?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 10:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210270#M61489</guid>
      <dc:creator>marina_rovira</dc:creator>
      <dc:date>2016-02-22T10:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(field) depending on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210271#M61490</link>
      <description>&lt;P&gt;to  chart of the percentage of these three values , try like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| top  Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;BR /&gt;
try thi :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| stats count by Type | eventstats sum(count) as total | eval percent = round(count/total) . " %" | fields - total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 11:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210271#M61490</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2016-02-22T11:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(field) depending on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210272#M61491</link>
      <description>&lt;P&gt;It works! for one month, do you if there is a possibility to do it over month? as a timechart or something?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 12:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210272#M61491</guid>
      <dc:creator>marina_rovira</dc:creator>
      <dc:date>2016-02-22T12:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(field) depending on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210273#M61492</link>
      <description>&lt;P&gt;try like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|bucket _time span=1months| top  Type by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 13:00:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210273#M61492</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2016-02-22T13:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(field) depending on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210274#M61493</link>
      <description>&lt;P&gt;okay, I'm approaching to it.&lt;/P&gt;

&lt;P&gt;I need a mix of these two queries, noy I have:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;on one hand: &lt;BR /&gt;
| stats sum(Count) as suma by Type | eventstats sum(suma) as total | eval percent = round((suma/total)*100,0)."%" &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;on the other hand:&lt;BR /&gt;
|bucket _time span=1months| top Type by _time  &lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Now, I need to sum the field Count for Type and moth. With this last thing you wrote me, I almost achieve it, but it counts the events and I need to sum a field for the events. &lt;/P&gt;

&lt;P&gt;Thanks, you're helping me a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 13:36:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210274#M61493</guid>
      <dc:creator>marina_rovira</dc:creator>
      <dc:date>2016-02-22T13:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(field) depending on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210275#M61494</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | bucket span=1mon _time | stats sum(count) as count by _time Type | eventstats sum(count) as Total by _time | eval Percent=round(count*100/Total) | timechart span=1mon max(Percent) by Type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 16:34:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210275#M61494</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-22T16:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(field) depending on another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210276#M61495</link>
      <description>&lt;P&gt;Thank you so much! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 17:28:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-field-depending-on-another-field/m-p/210276#M61495</guid>
      <dc:creator>marina_rovira</dc:creator>
      <dc:date>2016-02-22T17:28:02Z</dc:date>
    </item>
  </channel>
</rss>

