<?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 Need Help with sum over two columns without subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261113#M78363</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I need some help with a stats command.&lt;/P&gt;

&lt;P&gt;Given is Data like this csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Round,Player1,Player2,ScorePlayer1,ScorePlayer2
1,Harry,Tom,5,1
2,Eva,Mike,1,0
3,Harry,Eva,3,4
4,Mike,Tom,4,6
5,Tom,Harry,3,2
6,Mike,Eva,7,5
7,Eva,Tom,2,5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All I want to have is a stats command that gives me a table with the total amount of points for every player.&lt;BR /&gt;
I managed to do it with a subsearch but this feels kind of weird... there has to be a better solution.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2016 12:56:31 GMT</pubDate>
    <dc:creator>PPape</dc:creator>
    <dc:date>2016-08-30T12:56:31Z</dc:date>
    <item>
      <title>Need Help with sum over two columns without subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261113#M78363</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I need some help with a stats command.&lt;/P&gt;

&lt;P&gt;Given is Data like this csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Round,Player1,Player2,ScorePlayer1,ScorePlayer2
1,Harry,Tom,5,1
2,Eva,Mike,1,0
3,Harry,Eva,3,4
4,Mike,Tom,4,6
5,Tom,Harry,3,2
6,Mike,Eva,7,5
7,Eva,Tom,2,5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All I want to have is a stats command that gives me a table with the total amount of points for every player.&lt;BR /&gt;
I managed to do it with a subsearch but this feels kind of weird... there has to be a better solution.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 12:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261113#M78363</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-08-30T12:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with sum over two columns without subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261114#M78364</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search here | eval player=player1.";".player2 | eval score=ScorePlayer1.";".ScorePlayer2 | makemv player delim=";" | makemv score  delim=";" | eval z=mvzip(player, score) | mvexpand z | rex field=z "(?&amp;lt;player&amp;gt;[^;]+);(?&amp;lt;score&amp;gt;.*)" | stats sum(score) as score by player
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2016 13:14:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261114#M78364</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-30T13:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with sum over two columns without subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261115#M78365</link>
      <description>&lt;P&gt;Thank you very much. This worked and is faster than my subsearch.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 13:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261115#M78365</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-08-30T13:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with sum over two columns without subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261116#M78366</link>
      <description>&lt;P&gt;There is a little mistake. The mvzip command uses an comma as seperator so the semikolon in the rex command must be replaced with an comma. Than it works perfectly! Thank you again&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 09:49:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-with-sum-over-two-columns-without-subsearch/m-p/261116#M78366</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-08-31T09:49:41Z</dc:date>
    </item>
  </channel>
</rss>

