<?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 same field twice in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-same-field-twice/m-p/447401#M126828</link>
    <description>&lt;P&gt;Hi @TylerJVitale ,&lt;/P&gt;

&lt;P&gt;This sounds like a good place to use eventstats.&lt;/P&gt;

&lt;PRE&gt;
| stats sum(VOLUME) as VOLUME, count(USERNAME_O) as AFFECTED_USERS by APPLICATION
| eventstats sum(VOLUME) as TOTAL_VOLUME&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Jun 2019 19:05:58 GMT</pubDate>
    <dc:creator>jnudell_2</dc:creator>
    <dc:date>2019-06-24T19:05:58Z</dc:date>
    <item>
      <title>How to sum same field twice</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-same-field-twice/m-p/447400#M126827</link>
      <description>&lt;P&gt;I want to be able to sum the same field in order to create 2 different fields so that I can compare the Volume by application to the total volume.  Right now this is the structure of my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats sum(VOLUME) as VOLUME, count(USERNAME_O) as AFFECTED_USERS by APPLICATION | 
join [ search |&amp;nbsp; stats sum(VOLUME) as TOTAL_VOLUME | where TOTAL_VOLUME &amp;gt; 1 |&amp;nbsp; head 1 ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a more efficient way I can do this so that I don't have to use the "join" part and go through the whole index twice?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 18:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-same-field-twice/m-p/447400#M126827</guid>
      <dc:creator>TylerJVitale</dc:creator>
      <dc:date>2019-06-24T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum same field twice</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-same-field-twice/m-p/447401#M126828</link>
      <description>&lt;P&gt;Hi @TylerJVitale ,&lt;/P&gt;

&lt;P&gt;This sounds like a good place to use eventstats.&lt;/P&gt;

&lt;PRE&gt;
| stats sum(VOLUME) as VOLUME, count(USERNAME_O) as AFFECTED_USERS by APPLICATION
| eventstats sum(VOLUME) as TOTAL_VOLUME&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jun 2019 19:05:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-same-field-twice/m-p/447401#M126828</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2019-06-24T19:05:58Z</dc:date>
    </item>
  </channel>
</rss>

