<?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: Rex/RegEx Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142425#M39541</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search |rex ".*(?P&amp;lt;UnableCart&amp;gt;unable.*)" |table UnableCart&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2014 20:12:10 GMT</pubDate>
    <dc:creator>lukejadamec</dc:creator>
    <dc:date>2014-02-07T20:12:10Z</dc:date>
    <item>
      <title>Rex/RegEx Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142424#M39540</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I am trying to pull a text string out of some raw results using a simple regex. Heres my question: I would like to be able to get a stats count on the number of occurrances of this string. i would assume that you would have to put it into another field as it is simple text at the moment and not in a field. How would I do this? I am new to the rex/regex portion of Splunk and could use a little guidance.&lt;/P&gt;

&lt;P&gt;Here is the raw data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;log_source=TT.WebService.Internal.OrderIntegration.OrderIntegration - Unable to reserve shopping cart: Attempt to add tickets to the shopping cart resulted in a failure due to tickets no longer being on the exchange.
TT.Logic.TicketsNotFoundException: Exception of type 'TT.Logic.TicketsNotFoundException' was thrown.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I used \bUnable\b.* to get just the sentence "Unable to reserve shopping cart: Attempt to add tickets to the shopping cart resulted in a failure due to tickets no longer being on the exchange."&lt;/P&gt;

&lt;P&gt;I tried using "rex field=_raw...." and also creating a field named error like "rex field=error mode=sed" but am still not doing something correctly.&lt;/P&gt;

&lt;P&gt;Any advice would be appreciated, thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 19:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142424#M39540</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2014-02-07T19:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rex/RegEx Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142425#M39541</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search |rex ".*(?P&amp;lt;UnableCart&amp;gt;unable.*)" |table UnableCart&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 20:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142425#M39541</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-02-07T20:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rex/RegEx Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142426#M39542</link>
      <description>&lt;P&gt;Are you trying to count the number of events that contain a certain string, or are you trying to count the number of times a certain string appears in one event?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 20:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142426#M39542</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-02-07T20:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rex/RegEx Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142427#M39543</link>
      <description>&lt;P&gt;I am trying to count the number of events that contain this string&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 20:48:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142427#M39543</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2014-02-07T20:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rex/RegEx Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142428#M39544</link>
      <description>&lt;P&gt;In order to count events containing a certain string, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar "a certain string" | stats count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2014 20:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142428#M39544</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-02-07T20:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rex/RegEx Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142429#M39545</link>
      <description>&lt;P&gt;Getting closer. I think I can move forward from here through trial and error. Thanks so much for the guidance&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 20:53:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-RegEx-Question/m-p/142429#M39545</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2014-02-07T20:53:07Z</dc:date>
    </item>
  </channel>
</rss>

