<?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 create a regular expression to extract this string from four types of patterns in my sample data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213347#M62576</link>
    <description>&lt;P&gt;Hey.. Thanks for the answer.. It's good as a regular expression, but for some reason isn't working out in Splunk.. The "/" expression makes the results go haywire.. &lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2016 03:51:48 GMT</pubDate>
    <dc:creator>virtualme</dc:creator>
    <dc:date>2016-06-21T03:51:48Z</dc:date>
    <item>
      <title>How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213339#M62568</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the following 4 kinds of text in logs in a single file. I want to extract the string - Customer Num (starting with a number and followed by letters). I wish to write 1 single regex search which can handle all types of logs.&lt;/P&gt;

&lt;P&gt;I have been able to handle &amp;amp; extract the Customer Number from first 3 types of pattern (one regex for each row, which is not optimal), but the fourth is turning to be a problem because it is sort of a superset of the two lines of log.. &lt;/P&gt;

&lt;P&gt;Log  Text - &lt;BR /&gt;
"&lt;EM&gt;/GW_SS/SPut/s/&lt;/EM&gt;&lt;EM&gt;123abc&lt;/EM&gt;&lt;EM&gt;/&lt;/EM&gt;”&lt;BR /&gt;
"&lt;EM&gt;/GW_SS/SPut/icam/&lt;/EM&gt;&lt;EM&gt;165abc&lt;/EM&gt;&lt;EM&gt;/&lt;/EM&gt;”&lt;BR /&gt;
“&lt;EM&gt;/GW_SS/GtImFile/&lt;/EM&gt;&lt;EM&gt;2245dbvf&lt;/EM&gt;&lt;EM&gt;/ngH&lt;/EM&gt;”&lt;BR /&gt;
"&lt;EM&gt;/GW_SS/&lt;/EM&gt;&lt;EM&gt;123xy&lt;/EM&gt;&lt;EM&gt;/GetPendingP&lt;/EM&gt;"&lt;BR /&gt;
"&lt;EM&gt;/GW_SS/009876/connectInfo&lt;/EM&gt;"&lt;BR /&gt;
I have to extract "123abc" / "165abc", "2245dbvf" , "123xy" &amp;amp; "009876" which is a Customer ID from each row of logs. This string I need to extract always begins with a number, and have letters following it.. &lt;/P&gt;

&lt;P&gt;Can someone please help.. I want to manage all these with 1 single regex..&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 06:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213339#M62568</guid>
      <dc:creator>virtualme</dc:creator>
      <dc:date>2016-06-19T06:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213340#M62569</link>
      <description>&lt;P&gt;This regex string works with your sample data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (?&amp;lt;user&amp;gt;\d+\w+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jun 2016 18:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213340#M62569</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-06-19T18:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213341#M62570</link>
      <description>&lt;P&gt;Work like a charm -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search 
| eval data="/GW_SS/SPut/s/123abc/"
| rex  field=data "(?&amp;lt;user&amp;gt;\d+\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jun 2016 21:44:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213341#M62570</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-06-19T21:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213342#M62571</link>
      <description>&lt;P&gt;Please accept the answer.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 22:15:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213342#M62571</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-06-19T22:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213343#M62572</link>
      <description>&lt;P&gt;Not my question ; -) &lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 10:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213343#M62572</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-06-20T10:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213344#M62573</link>
      <description>&lt;P&gt;Thanks for your response... This serves the the type 4 &amp;amp; 5 of the logs... &lt;BR /&gt;
Although I have reg-ex for the first 3 types, I am looking for a solution wherein I can handle all 4 types in 1 single reg-ex to extract the Customer ID.. &lt;BR /&gt;
Do you think its possible?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 21:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213344#M62573</guid>
      <dc:creator>virtualme</dc:creator>
      <dc:date>2016-06-20T21:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213345#M62574</link>
      <description>&lt;P&gt;Thanks for your response... This serves the the type 4 &amp;amp; 5 of the logs... &lt;BR /&gt;
Although I have reg-ex for the first 3 types, I am looking for a solution wherein I can handle all 4 types in 1 single reg-ex to extract the Customer ID.. &lt;BR /&gt;
Do you think its possible?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 21:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213345#M62574</guid>
      <dc:creator>virtualme</dc:creator>
      <dc:date>2016-06-20T21:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213346#M62575</link>
      <description>&lt;P&gt;This should capture all scenarios&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\/(?&amp;lt;user&amp;gt;\d+\w*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jun 2016 22:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213346#M62575</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-20T22:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regular expression to extract this string from four types of patterns in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213347#M62576</link>
      <description>&lt;P&gt;Hey.. Thanks for the answer.. It's good as a regular expression, but for some reason isn't working out in Splunk.. The "/" expression makes the results go haywire.. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 03:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regular-expression-to-extract-this-string-from/m-p/213347#M62576</guid>
      <dc:creator>virtualme</dc:creator>
      <dc:date>2016-06-21T03:51:48Z</dc:date>
    </item>
  </channel>
</rss>

