<?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: Is there a regex syntax for undefined number of characters? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270922#M190112</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "commonName (?&amp;lt;commonName&amp;gt;(\S+\s*)+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 25 Jul 2016 20:03:29 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-07-25T20:03:29Z</dc:date>
    <item>
      <title>Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270920#M190110</link>
      <description>&lt;P&gt;I need to get commonName for ISSUER NAME but there are multiple issues: there are more than one commonName(one for ISSUER NAME and another for SUBJECT NAME), commonName position below ISSUER NAME is not fixed, and commonName will sometimes be a string of words with spaces between them. Is there a syntax for an indefinite number of characters and a syntax for scanning a string of words and spaces?&lt;/P&gt;

&lt;P&gt;Data:&lt;BR /&gt;
&lt;STRONG&gt;(0)ISSUER NAME&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;
countryName US&lt;BR /&gt;
 organizationName   Lucky Stars&lt;BR /&gt;
 &lt;STRONG&gt;commonName&lt;/STRONG&gt; &lt;STRONG&gt;Dev Lucky Stars Internal PKI Firmwide Generic Issuing CA 6&lt;/STRONG&gt;&lt;BR /&gt;
&lt;STRONG&gt;(0)SUBJECT NAME&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;
countryName US&lt;BR /&gt;
 stateOrProvinceName    New York&lt;BR /&gt;
 localityName   New York&lt;BR /&gt;
 organizationName   Lucky Stars&lt;BR /&gt;
 &lt;STRONG&gt;commonName   iklabnac04.ms.com&lt;/STRONG&gt;&lt;BR /&gt;
 emailAddress   &lt;A href="mailto:mike.ng@luckystars.com"&gt;mike.ng@luckystars.com&lt;/A&gt;&lt;BR /&gt;
(0)Valid From   May 26 03:33:39 2016 GMT&lt;BR /&gt;
(0)Valid Till   May 26 03:33:39 2018 GMT&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 19:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270920#M190110</guid>
      <dc:creator>jenniferleenyc</dc:creator>
      <dc:date>2016-07-25T19:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270921#M190111</link>
      <description>&lt;P&gt;Is the commonName field always prefixed by "commonName"?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 20:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270921#M190111</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-07-25T20:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270922#M190112</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "commonName (?&amp;lt;commonName&amp;gt;(\S+\s*)+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 20:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270922#M190112</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-25T20:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270923#M190113</link>
      <description>&lt;P&gt;Try this. There can be more than 2 commonName, adjust the max_match count and eval statements accordingly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | rex max_match=2 "(?&amp;lt;commonName&amp;gt;commonName[^\t\n]+)"  | eval commonName_Issuer=mvindex(commonName, 0) | eval commonName_Subject=mvindex(commonName, 1) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 20:05:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270923#M190113</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-25T20:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270924#M190114</link>
      <description>&lt;P&gt;would this be an inline command?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 20:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270924#M190114</guid>
      <dc:creator>jenniferleenyc</dc:creator>
      <dc:date>2016-07-25T20:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270925#M190115</link>
      <description>&lt;P&gt;I'm a little unfamiliar with regex syntax. What do the "..." and pipes indicate? What do I replace the "..." with?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 20:53:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270925#M190115</guid>
      <dc:creator>jenniferleenyc</dc:creator>
      <dc:date>2016-07-25T20:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270926#M190116</link>
      <description>&lt;P&gt;Yes, this would be added to your current search. Post the search you're using if you've any confusion where it should be added.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 20:55:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270926#M190116</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-25T20:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270927#M190117</link>
      <description>&lt;P&gt;the ... just means etc. At the begining it is your base search, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nameofyourindex sourcetype=nameofsourcetype | rex max_match=2 "(?&amp;lt;commonName&amp;gt;commonName[^\t\n]+)"  | eval commonName_Issuer=mvindex(commonName, 0) | eval commonName_Subject=mvindex(commonName, 1) | table _time commonName_Issuer commonName_Subject
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 20:57:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270927#M190117</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-25T20:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270928#M190118</link>
      <description>&lt;P&gt;This looks like a search string for Search&amp;amp;Reporting. Can I also put this string in the extraction/transform field?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 21:04:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270928#M190118</guid>
      <dc:creator>jenniferleenyc</dc:creator>
      <dc:date>2016-07-25T21:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a regex syntax for undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270929#M190119</link>
      <description>&lt;P&gt;If you want the regex for the extraction/transform field, you can use the following in your props &amp;amp; transforms&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;props&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[unique_stanza_name]
REPORT-common = commName_extract
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;transforms&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[commName_extract]
REGEX=(?&amp;lt;commonName&amp;gt;commonName[^\t\n]+)
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 21:26:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-regex-syntax-for-undefined-number-of-characters/m-p/270929#M190119</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-25T21:26:53Z</dc:date>
    </item>
  </channel>
</rss>

