<?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 the values of a multivalue field.? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303762#M91376</link>
    <description>&lt;P&gt;Thanks for amazing explanation..!!&lt;/P&gt;</description>
    <pubDate>Sat, 20 May 2017 13:47:54 GMT</pubDate>
    <dc:creator>gvnd</dc:creator>
    <dc:date>2017-05-20T13:47:54Z</dc:date>
    <item>
      <title>How to sum the values of a multivalue field.?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303757#M91371</link>
      <description>&lt;P&gt;Hi my query is:&lt;BR /&gt;
index=_internal earliest=-60m@m latest=now|transaction method | table root method status bytes | nomv bytes&lt;/P&gt;

&lt;P&gt;result for above query is:&lt;BR /&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/2971i8776A8F11374F2C4/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;Here, I want to sum of all the values of "bytes" field . i.e single value of bytes field for each method.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 13:37:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303757#M91371</guid>
      <dc:creator>gvnd</dc:creator>
      <dc:date>2017-05-19T13:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum the values of a multivalue field.?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303758#M91372</link>
      <description>&lt;P&gt;Switch from transaction to &lt;STRONG&gt;stats&lt;/STRONG&gt;. Add sourcetype/source to your query if it is applicable. _internal index contains a lot of Splunk's sourcetypes for internal purpose.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=* earliest=-60m latest=now
| stats values(root) as root values(status) as status sum(bytes) as bytes by method
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated to remove count as you dont seem to require eventcount or duration.&lt;/P&gt;

&lt;P&gt;PS: This is not a use case for transaction and stats should perform better in this case.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 14:49:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303758#M91372</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-19T14:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum the values of a multivalue field.?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303759#M91373</link>
      <description>&lt;P&gt;using eventstats:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index = _internal | transaction method | table root method status bytes | eventstats sum(bytes) as Total_Bytes_by_Transaction | fields - bytes
&lt;/CODE&gt;&lt;/PRE&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/2970i1C564383AC3842C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 14:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303759#M91373</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-05-19T14:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum the values of a multivalue field.?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303760#M91374</link>
      <description>&lt;P&gt;You need a unique field for each transaction in order for eventstats to give you a by-transaction sum of the bytes.  If you want the total bytes associated with each transaction, then you can do this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest=-60m@m latest=now
| transaction method 
| table root method status bytes 
| streamstats count as tranno
| eventstats sum(bytes) as totalbytes by tranno
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...then, only if you want to retain the byte details for some reason... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| nomv bytes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... or if not &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| field - bytes
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 May 2017 15:20:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303760#M91374</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-19T15:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum the values of a multivalue field.?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303761#M91375</link>
      <description>&lt;P&gt;thank you for that!&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 15:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303761#M91375</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-05-19T15:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum the values of a multivalue field.?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303762#M91376</link>
      <description>&lt;P&gt;Thanks for amazing explanation..!!&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2017 13:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303762#M91376</guid>
      <dc:creator>gvnd</dc:creator>
      <dc:date>2017-05-20T13:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum the values of a multivalue field.?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303763#M91377</link>
      <description>&lt;P&gt;This works, but I found out that you have to use &lt;EM&gt;mvlist=t&lt;/EM&gt; option in &lt;EM&gt;transaction&lt;/EM&gt;, otherwise, repeated values in the mv field are not accounted for. i.e.,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest=-60m@m latest=now
 | transaction  mvlist=t method 
 | table root method status bytes 
 | streamstats count as tranno
 | eventstats sum(bytes) as totalbytes by tranno
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Dec 2017 06:52:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-the-values-of-a-multivalue-field/m-p/303763#M91377</guid>
      <dc:creator>tedwroks</dc:creator>
      <dc:date>2017-12-02T06:52:28Z</dc:date>
    </item>
  </channel>
</rss>

