<?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 help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198579#M57435</link>
    <description>&lt;P&gt;Great. Don't forget to mark this as solved.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Mar 2014 18:10:06 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-03-25T18:10:06Z</dc:date>
    <item>
      <title>REGEX help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198576#M57432</link>
      <description>&lt;P&gt;Please help with REGEX problem.&lt;/P&gt;

&lt;P&gt;Sample Data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Bank summary of John_Doe2/default (0.03 seconds): deposit (15 dollars, 0 cents), withdrawal (2 dollars, 0 cents).
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the regex I use to extract the numbers.  It works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\sdeposit \((?&amp;lt;Deposit&amp;gt;\d+)" | rex "\s*withdrawal \((?&amp;lt;Withdrawal&amp;gt;\d+)" | table Deposit Withdrawal | addcoltotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I want to include "Names" in my search and put them in one table along with the rest of the numbers.  I tried the REGEX below, but I keep getting blanks in the "Name" column.  What am I missing here?&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 | addcoltotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Mar 2014 20:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198576#M57432</guid>
      <dc:creator>rpascua</dc:creator>
      <dc:date>2014-03-24T20:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198577#M57433</link>
      <description>&lt;P&gt;Try this:&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 | addcoltotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There were some extra opening parentheses, and no + quantifier.&lt;/P&gt;

&lt;P&gt;Note, if you can control that output it's easier to change it to key=value pairs - then you don't need to mess around with regular expressions for field extraction.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 21:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198577#M57433</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-24T21:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198578#M57434</link>
      <description>&lt;P&gt;It's the little things.  Thanks!  It works!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 17:13:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198578#M57434</guid>
      <dc:creator>rpascua</dc:creator>
      <dc:date>2014-03-25T17:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198579#M57435</link>
      <description>&lt;P&gt;Great. Don't forget to mark this as solved.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 18:10:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198579#M57435</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-25T18:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198580#M57436</link>
      <description>&lt;P&gt;I posted a new question titled "Regex Money" so feel free to look it up and post your response.&lt;/P&gt;

&lt;P&gt;Here's my new question:&lt;BR /&gt;
If John took money out three times within a 24-hour period, using the REGEX below, I would have a 3-line output.  &lt;/P&gt;

&lt;P&gt;| 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 | addtotals Withdrawal "\s*withdrawal ((?&lt;WITHDRAWAL&gt;\d+)"&lt;/WITHDRAWAL&gt;&lt;/WITHDRAWAL&gt;&lt;/DEPOSIT&gt;&lt;/NAME&gt;&lt;/P&gt;

&lt;P&gt;But all I need is a one-liner like this:&lt;/P&gt;

&lt;P&gt;John (Deposit: 0) (Withdrawal: 110) (Total Withdrawal: 110)&lt;/P&gt;

&lt;P&gt;I tried multiple combinations but keep coming up emp&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help/m-p/198580#M57436</guid>
      <dc:creator>rpascua</dc:creator>
      <dc:date>2020-09-28T16:13:53Z</dc:date>
    </item>
  </channel>
</rss>

