<?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 attract a specific word from string using rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505992#M141544</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222807"&gt;@thinhdinh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you can use a regex like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;text&amp;gt;Hello world)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/YXExE4/1" target="_blank"&gt;https://regex101.com/r/YXExE4/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if instead you want to teke the text between quotes in that position (non only Hello world), you could try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"(?&amp;lt;text&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/YXExE4/2" target="_blank"&gt;https://regex101.com/r/YXExE4/2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2020 14:59:32 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-06-24T14:59:32Z</dc:date>
    <item>
      <title>How to attract a specific word from string using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505964#M141532</link>
      <description>&lt;P&gt;Hello Splunk Experts!&lt;/P&gt;&lt;P&gt;I have a string like below&lt;/P&gt;&lt;P&gt;rex " - - (?&amp;lt;text&amp;gt;foo|bar) " | .....&lt;/P&gt;&lt;P&gt;I want to take the text when a word match foo or bar. The string include whitespace as above. Thank in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 13:42:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505964#M141532</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-06-24T13:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to attract a specific word from string using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505967#M141533</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222807"&gt;@thinhdinh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;did you tried?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;text&amp;gt;foo|bar)"&lt;/LI-CODE&gt;&lt;P&gt;if you want only isolated foo/bar word, try this:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;text&amp;gt;foo|bar)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;| rex "\s+(?&amp;lt;text&amp;gt;foo|bar)\s+"&lt;/LI-CODE&gt;&lt;P&gt;If you share some example I could verify my regex.&lt;/P&gt;&lt;P&gt;If you want you could also use regex101.com to test this regex with your samples.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 14:00:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505967#M141533</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-06-24T14:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to attract a specific word from string using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505972#M141536</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your answer. Basically I have a event like this:&lt;/P&gt;&lt;PRE&gt;Mon Mar 19 20:16:27 2018 Info: Bounced: DCID 8413617 MID 19338947 - - "Hello world"  From: &amp;lt;MariaDubois@example.com&amp;gt; To: &amp;lt;zecora@buttercupgames.com&amp;gt; RID 0 - 5.4.7 - Delivery expired (message too old) ('000', ['timeout']) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get the "Hello world" from above event using rex command?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 14:06:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505972#M141536</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-06-24T14:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to attract a specific word from string using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505973#M141537</link>
      <description>&lt;P&gt;Okie, I was missing field=_raw. Now I got it worked, thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 14:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505973#M141537</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-06-24T14:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to attract a specific word from string using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505977#M141539</link>
      <description>&lt;P&gt;&lt;SPAN&gt;field=_raw isn't mandatory!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 14:15:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505977#M141539</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-06-24T14:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to attract a specific word from string using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505992#M141544</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222807"&gt;@thinhdinh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you can use a regex like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;text&amp;gt;Hello world)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/YXExE4/1" target="_blank"&gt;https://regex101.com/r/YXExE4/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if instead you want to teke the text between quotes in that position (non only Hello world), you could try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"(?&amp;lt;text&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/YXExE4/2" target="_blank"&gt;https://regex101.com/r/YXExE4/2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 14:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-attract-a-specific-word-from-string-using-rex/m-p/505992#M141544</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-06-24T14:59:32Z</dc:date>
    </item>
  </channel>
</rss>

