<?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 regex specific word string? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537481#M151952</link>
    <description>&lt;P&gt;Adding "\b" before Name doesn't do the trick. By adding a comma and space, it will only capture data in that format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I notice some logs may or may not have a comma and a space.&amp;nbsp; But the string "Version=" is definitely there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 18:49:47 GMT</pubDate>
    <dc:creator>limalbert</dc:creator>
    <dc:date>2021-01-27T18:49:47Z</dc:date>
    <item>
      <title>How to regex specific word string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537469#M151943</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Ignoring commas and spaces, how do I grab just the name string from the below log? Below regex kept returning the value of FirstName. It's not seeing name as "Name=", but as "*Name=*".&lt;/P&gt;&lt;P&gt;Regex:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"Name=(?&amp;lt;nameCaptured&amp;gt;[^\,]*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FirstName=Hello, LastName=World, Name=HelloWorld, Address=NoAddress&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 18:01:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537469#M151943</guid>
      <dc:creator>limalbert</dc:creator>
      <dc:date>2021-01-27T18:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex specific word string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537471#M151945</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/28886"&gt;@limalbert&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Actually, your regex is matching 3 groups and the first matched value is returned to the field&amp;nbsp;&lt;STRONG&gt;nameCaptured&lt;/STRONG&gt;.&amp;nbsp; If you set &lt;STRONG&gt;max_match=0&lt;/STRONG&gt; in &lt;STRONG&gt;rex&lt;/STRONG&gt; command you'll see all the matches,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="FirstName=Hello, LastName=World, Name=HelloWorld, Address=NoAddress" 
| rex max_match=0 "Name=(?&amp;lt;nameCaptured&amp;gt;[^\,]*)" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can get the value of &lt;STRONG&gt;Name&lt;/STRONG&gt; as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="FirstName=Hello, LastName=World, Name=HelloWorld, Address=NoAddress" 
| rex max_match=0 "Name=(?&amp;lt;nameCaptured&amp;gt;[^\,]*)" 
| eval NameCaptured=mvindex(nameCaptured, 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or change regex to match only &lt;STRONG&gt;Name=&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="FirstName=Hello, LastName=World, Name=HelloWorld, Address=NoAddress" 
| rex "\W+Name=(?&amp;lt;nameCaptured&amp;gt;[^\,]*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, an upvote/like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 18:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537471#M151945</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-01-27T18:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex specific word string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537472#M151946</link>
      <description>&lt;P&gt;There is an implicit '.*' at the beginning of every regex unless it starts with '^'.&amp;nbsp; To get a string and not a substring the regex must uniquely identify the string to find.&amp;nbsp; Try one of these:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"\bName=(?&amp;lt;nameCaptured&amp;gt;[^\,]*)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;", Name=(?&amp;lt;nameCaptured&amp;gt;[^\,]*)"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Jan 2021 18:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537472#M151946</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-27T18:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex specific word string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537481#M151952</link>
      <description>&lt;P&gt;Adding "\b" before Name doesn't do the trick. By adding a comma and space, it will only capture data in that format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I notice some logs may or may not have a comma and a space.&amp;nbsp; But the string "Version=" is definitely there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 18:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537481#M151952</guid>
      <dc:creator>limalbert</dc:creator>
      <dc:date>2021-01-27T18:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex specific word string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537518#M151967</link>
      <description>&lt;P&gt;Try &lt;FONT face="courier new,courier"&gt;\W&lt;/FONT&gt; in place of &lt;FONT face="courier new,courier"&gt;\b&lt;/FONT&gt;.&amp;nbsp; If that doesn't work then please share the full set of requirements as well as more complete sample events so we can offer better solutions.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 01:24:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-specific-word-string/m-p/537518#M151967</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-28T01:24:08Z</dc:date>
    </item>
  </channel>
</rss>

