<?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: Regular expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186215#M53644</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;The regex works for me, only for the second sample event. The first event has also letters, not just digits as you stated it should be:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;ID starts with alphabet P followed by 8 digits&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;This sentence means this regex: P(?&amp;lt;ID&amp;gt;\d{8})&lt;/P&gt;

&lt;P&gt;If you want to include also letters, you should give us additional constrains of the surroundind data to make it work for all cases. Maybe you can post additional sample events&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2015 14:06:27 GMT</pubDate>
    <dc:creator>gfuente</dc:creator>
    <dc:date>2015-05-12T14:06:27Z</dc:date>
    <item>
      <title>Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186206#M53635</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can someone help me in writing the regex for following string&lt;/P&gt;

&lt;P&gt;20141128082428PAASSUB 00.?9CDPCI8I USER ACTION TITLE            295211P3055E464   01Q0009000054146746SAHEER SHAIK12 &lt;BR /&gt;
20141202054437PBSALAK 00.94_VCT90U  Windows security event logs       P43833244199105   02P8758878262824579SAI LAKSMII  &lt;/P&gt;

&lt;P&gt;I need to extract the last string and name it as user.  eg: user=SAHEER SHAIK.  Also extract the digit "P43833244" and name it as ID.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 11:47:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186206#M53635</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-05-12T11:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186207#M53636</link>
      <description>&lt;P&gt;can you confirm these??&lt;/P&gt;

&lt;P&gt;No space between these values and name &lt;CODE&gt;01Q0009000054146746SAHEER SHAIK12&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Is ID you specified is off alphabet followed by 8 digits out of this &lt;CODE&gt;P43833244199105&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:10:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186207#M53636</guid>
      <dc:creator>krish3</dc:creator>
      <dc:date>2015-05-12T13:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186208#M53637</link>
      <description>&lt;P&gt;There is no space between 01Q0009000054146746SAHEER SHAIK12&lt;BR /&gt;
ID starts with alphabet P followed by 8 digits&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186208#M53637</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-05-12T13:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186209#M53638</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;Regex for ID:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;P(?&amp;lt;ID&amp;gt;\d{8})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regex for name:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;name&amp;gt;[^\d]*)\d*\s*$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:27:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186209#M53638</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2015-05-12T13:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186210#M53639</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Regex for name is working.  Can you pls explain the expression for me.&lt;/P&gt;

&lt;P&gt;And Regex for ID is not working.  This is capturing first 8 digits of the string.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186210#M53639</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-05-12T13:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186211#M53640</link>
      <description>&lt;P&gt;This should do:&lt;/P&gt;

&lt;P&gt;(?&amp;lt;ID&amp;gt;P\d{8})&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:47:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186211#M53640</guid>
      <dc:creator>ConnorG</dc:creator>
      <dc:date>2015-05-12T13:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186212#M53641</link>
      <description>&lt;P&gt;Updated, &lt;/P&gt;

&lt;P&gt;The first regex was missing a P&lt;/P&gt;

&lt;P&gt;The regex for the name works this way, goes to the end of the event, leaves out of the capturing group any spaces an numbers, and then captures everything backwards until the first digit is found&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186212#M53641</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2015-05-12T13:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186213#M53642</link>
      <description>&lt;P&gt;Thank you for the explanation.  Its clear now.&lt;/P&gt;

&lt;P&gt;But ID regex is still not working.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:56:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186213#M53642</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-05-12T13:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186214#M53643</link>
      <description>&lt;P&gt;this is not working Connor..&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 13:57:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186214#M53643</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-05-12T13:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186215#M53644</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;The regex works for me, only for the second sample event. The first event has also letters, not just digits as you stated it should be:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;ID starts with alphabet P followed by 8 digits&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;This sentence means this regex: P(?&amp;lt;ID&amp;gt;\d{8})&lt;/P&gt;

&lt;P&gt;If you want to include also letters, you should give us additional constrains of the surroundind data to make it work for all cases. Maybe you can post additional sample events&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 14:06:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186215#M53644</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2015-05-12T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186216#M53645</link>
      <description>&lt;P&gt;Please try this:&lt;/P&gt;

&lt;P&gt;rex field=_raw (?&amp;lt;ID&amp;gt;Pw{8})w*s(?&amp;lt;First&amp;gt;w+)s(?&amp;lt;Last&amp;gt;w+$) | rex field=First w+d(?&amp;lt;First_Name&amp;gt;w+$) | table ID First_Name Last_Name&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186216#M53645</guid>
      <dc:creator>regexcracker</dc:creator>
      <dc:date>2020-09-28T19:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186217#M53646</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;rex field=_raw (?&amp;lt;ID&amp;gt;P\w{8})\w*\s(?&amp;lt;First&amp;gt;\w+)\s(?&amp;lt;Last&amp;gt;\w+$) | rex field=First \w+\d(?&amp;lt;First_Name&amp;gt;\w+$) | table ID First_Name Last_Name&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression/m-p/186217#M53646</guid>
      <dc:creator>regexcracker</dc:creator>
      <dc:date>2020-09-28T19:54:02Z</dc:date>
    </item>
  </channel>
</rss>

