<?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: Extracting words in a string with regular expressions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580812#M202344</link>
    <description>&lt;P&gt;You can use rex max_match=0 to get multiple matches&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 16:05:20 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-01-12T16:05:20Z</dc:date>
    <item>
      <title>Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580722#M202302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i need help to extract word from a string&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;string&lt;/P&gt;&lt;P&gt;Security agent installation attempted Endpoint: (Not Found)&lt;BR /&gt;Security agent intstallation attempted Endpoint: hostname&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;result&lt;/P&gt;&lt;P&gt;Not Found&lt;/P&gt;&lt;P&gt;hostname&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i construct a regular expression to extract out what i wanted?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 06:54:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580722#M202302</guid>
      <dc:creator>7ryota</dc:creator>
      <dc:date>2022-01-12T06:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580724#M202303</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242115"&gt;@7ryota&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could use two regexes like the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex ":\s+\(*(?&amp;lt;result&amp;gt;.+)"
| rex field=result "^(?&amp;lt;result&amp;gt;[^)]+)"&lt;/LI-CODE&gt;&lt;P&gt;The first extract the full value and the second deletes the parenthesis when present.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 07:27:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580724#M202303</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-12T07:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580731#M202305</link>
      <description>&lt;P&gt;not sure how to remove the ")" at the "Not Found)"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults | eval string="Security agent installation attempted Endpoint: (Not Found)
Security agent intstallation attempted Endpoint: hostname" 
| rex field=string max_match=0 ":\s+\(?(?P&amp;lt;result&amp;gt;.+)"
|table string result&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rex-string.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17532iD058287FD05710A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="rex-string.png" alt="rex-string.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 08:04:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580731#M202305</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2022-01-12T08:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580736#M202308</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex ":\s+\(*(?&amp;lt;result&amp;gt;[^)]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 08:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580736#M202308</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-12T08:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580783#M202329</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;... i am trying to learn and understand your rex, as i ran it, but it does not fetch the string.. not sure what went wrong.. please suggest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i used this search:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults | eval string="Security agent installation attempted Endpoint: (Not Found) 
Security agent intstallation attempted Endpoint: hostname" 
| rex ":\s+\(*(?&amp;lt;result&amp;gt;[^)]+)"
|table string result&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rex-string1.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17536i77E4DFA37083B5E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="rex-string1.png" alt="rex-string1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 13:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580783#M202329</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2022-01-12T13:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580787#M202330</link>
      <description>&lt;P&gt;By default, rex operates on the _raw field. Either change your eval so it assigns to _raw rather than string or add field=string to the rex&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 14:08:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580787#M202330</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-12T14:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580808#M202341</link>
      <description>&lt;P&gt;Sure &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;, but, still it found only first match.. the "hostname" was not matched..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rex-string2.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17537iBB8F149237AE431B/image-size/large?v=v2&amp;amp;px=999" role="button" title="rex-string2.png" alt="rex-string2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 15:35:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580808#M202341</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2022-01-12T15:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting words in a string with regular expressions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580812#M202344</link>
      <description>&lt;P&gt;You can use rex max_match=0 to get multiple matches&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 16:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-words-in-a-string-with-regular-expressions/m-p/580812#M202344</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-12T16:05:20Z</dc:date>
    </item>
  </channel>
</rss>

