<?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: Regex Money in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199064#M57633</link>
    <description>&lt;P&gt;That's what the &lt;CODE&gt;by Name&lt;/CODE&gt; is for.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Mar 2014 20:30:13 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-03-25T20:30:13Z</dc:date>
    <item>
      <title>Regex Money</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199061#M57630</link>
      <description>&lt;P&gt;My Regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\sof (?&amp;lt;Name&amp;gt;[A-Za-z0-9_]+)" | rex "\sdeposit \((?&amp;lt;Deposit&amp;gt;\d+)" | rex "\s*withdrawal \((?&amp;lt;Withdrawal&amp;gt;\d+)" | table Name Deposit Withdrawal | addtotals Withdrawal "\s*withdrawal \((?&amp;lt;Withdrawal&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem:&lt;/P&gt;

&lt;P&gt;If John took money out three times within a 24-hour period, using the REGEX above, I would have a 3-liner output like below...&lt;/P&gt;

&lt;P&gt;John   Deposit 0   Withdrawal 50   Total Withdrawal 50&lt;/P&gt;

&lt;P&gt;John   Deposit 0   Withdrawal 35   Total Withdrawal 35&lt;/P&gt;

&lt;P&gt;John   Deposit 0   Withdrawal 25   Total Withdrawal 25&lt;/P&gt;

&lt;P&gt;But all I need is a one-liner like so:&lt;/P&gt;

&lt;P&gt;John   Deposit 0   Withdrawal 110   Total Withdrawal 110&lt;/P&gt;

&lt;P&gt;I tried multiple combinations on that last line of code (addtotals) but keep coming up empty.  Any assistance would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 19:46:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199061#M57630</guid>
      <dc:creator>rpascua</dc:creator>
      <dc:date>2014-03-25T19:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Money</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199062#M57631</link>
      <description>&lt;P&gt;You're trying to calculate the sum of deposits and withdrawals per person? Append this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats sum(Deposit) sum(Withdrawal) by Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Mar 2014 20:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199062#M57631</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-25T20:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Money</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199063#M57632</link>
      <description>&lt;P&gt;Yes, I tried "stats" as well.  But instead of typing each name (ie. John, Stacey, Logan) I'm trying to parse out an entire list of names along with the number of withdrawals they made within the last 24 hours.&lt;/P&gt;

&lt;P&gt;I'm trying to avoid doing this for each names:&lt;/P&gt;

&lt;P&gt;John " withdrawal" | rex "\sof (?&lt;NAME&gt;[A-Za-z0-9_]+)" | rex "\sdeposit ((?&lt;DEPOSIT&gt;\d+)" | rex "\s*withdrawal ((?&lt;WITHDRAWAL&gt;\d+)" | table Name Deposit Withdrawal | stats sum(Withdrawal)&lt;/WITHDRAWAL&gt;&lt;/DEPOSIT&gt;&lt;/NAME&gt;&lt;/P&gt;

&lt;P&gt;Stacey " withdrawal" | rex "\sof (?&lt;NAME&gt;[A-Za-z0-9_]+)" | rex ........ and so on&lt;/NAME&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 20:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199063#M57632</guid>
      <dc:creator>rpascua</dc:creator>
      <dc:date>2014-03-25T20:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Money</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199064#M57633</link>
      <description>&lt;P&gt;That's what the &lt;CODE&gt;by Name&lt;/CODE&gt; is for.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 20:30:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199064#M57633</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-25T20:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Money</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199065#M57634</link>
      <description>&lt;P&gt;Oh.. duh.  It works!  Thank you Splunk God!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 20:40:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199065#M57634</guid>
      <dc:creator>rpascua</dc:creator>
      <dc:date>2014-03-25T20:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Money</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199066#M57635</link>
      <description>&lt;P&gt;And remember that you can write a single "Rex" matching all the different fields you need to extract, if of course are ALL present in the same event...&lt;/P&gt;

&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2014 23:41:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Money/m-p/199066#M57635</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-04-01T23:41:09Z</dc:date>
    </item>
  </channel>
</rss>

