<?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: Rex to Extract Specific Word in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358962#M106102</link>
    <description>&lt;P&gt;If it helps, here is sample data where id should not be extracted:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;The first part of registration was&lt;BR /&gt;
straight forward but I have been left&lt;BR /&gt;
confused as to if the process was&lt;BR /&gt;
completed or not ? when I tried to&lt;BR /&gt;
continue the system did not recognise&lt;BR /&gt;
my identity ?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Fri, 29 Dec 2017 10:29:12 GMT</pubDate>
    <dc:creator>IRHM73</dc:creator>
    <dc:date>2017-12-29T10:29:12Z</dc:date>
    <item>
      <title>Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358954#M106094</link>
      <description>&lt;P&gt;Hi, I wonder whether someone maybe able to help me please.&lt;/P&gt;

&lt;P&gt;I'm using the following rex to extract the word ID from a text string, which can be written in many permutations, e.g. ID, Id, id.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=text "/^|[^a-zA-Z](?&amp;lt;a&amp;gt;(?i)id)[^a-zA-Z]|$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could someone tell me please, is there a simpler way to write this?&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 06:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358954#M106094</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-12-29T06:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358955#M106095</link>
      <description>&lt;P&gt;This will place any single combination of ( &lt;CODE&gt;ID&lt;/CODE&gt;, &lt;CODE&gt;iD&lt;/CODE&gt;, &lt;CODE&gt;Id&lt;/CODE&gt;, or &lt;CODE&gt;id&lt;/CODE&gt;) that is found in field &lt;CODE&gt;text&lt;/CODE&gt; into field &lt;CODE&gt;a&lt;/CODE&gt;, if that is what you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=text "(?i)(?&amp;lt;a&amp;gt;id)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Dec 2017 07:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358955#M106095</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-29T07:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358956#M106096</link>
      <description>&lt;P&gt;Hi, thank you for this @DalJeanis, but unfortunately it doesn't quite work because it extracts the id from words such as "said".&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 07:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358956#M106096</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-12-29T07:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358957#M106097</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; | rex field=text "\s(?i)(?&amp;lt;a&amp;gt;id)\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it will match word ID(case insensitive) from a text string&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 08:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358957#M106097</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2017-12-29T08:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358958#M106098</link>
      <description>&lt;P&gt;Hi @493669, thank you for this.&lt;/P&gt;

&lt;P&gt;It certainly extracts the correct words in the different formats, but unfortunately if there is a succeeding special character such a s a . or ) it doesn't extract the word.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 08:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358958#M106098</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-12-29T08:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358959#M106099</link>
      <description>&lt;P&gt;Can you try below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=text "\s(?i)(?&amp;lt;a&amp;gt;id)."
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Dec 2017 09:59:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358959#M106099</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2017-12-29T09:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358960#M106100</link>
      <description>&lt;P&gt;Hi, thank you for coming back to me with this.&lt;/P&gt;

&lt;P&gt;I'm sorry this has a similar issue in that it extracts id from the word "identity".&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 10:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358960#M106100</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-12-29T10:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358961#M106101</link>
      <description>&lt;P&gt;Can you add some sample data?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 10:19:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358961#M106101</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-29T10:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358962#M106102</link>
      <description>&lt;P&gt;If it helps, here is sample data where id should not be extracted:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;The first part of registration was&lt;BR /&gt;
straight forward but I have been left&lt;BR /&gt;
confused as to if the process was&lt;BR /&gt;
completed or not ? when I tried to&lt;BR /&gt;
continue the system did not recognise&lt;BR /&gt;
my identity ?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 10:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358962#M106102</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-12-29T10:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358963#M106103</link>
      <description>&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=text "\b(?i)(?&amp;lt;a&amp;gt;id)\b"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Dec 2017 14:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358963#M106103</guid>
      <dc:creator>wenthold</dc:creator>
      <dc:date>2017-12-29T14:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358964#M106104</link>
      <description>&lt;P&gt;Thanks for sample data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=text "\b(?i)(?id)\b"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here \b matches any position that lies at boundary of word "id"&lt;BR /&gt;
(?i) --&amp;gt; case insensitive match&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 16:48:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358964#M106104</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2017-12-29T16:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358965#M106105</link>
      <description>&lt;P&gt;&lt;CODE&gt;| rex field=text (?&amp;lt;!\w)(?i)(?&amp;lt;a&amp;gt;id)(?!\w)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;That looks for the term &lt;CODE&gt;id&lt;/CODE&gt; not surrounded by other word characters.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 17:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358965#M106105</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-29T17:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358966#M106106</link>
      <description>&lt;P&gt;Hi @wenthold, this works great, thank you very much for taking the time to put this together.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 07:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358966#M106106</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-01-02T07:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rex to Extract Specific Word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358967#M106107</link>
      <description>&lt;P&gt;Hi @493669, as per the solution from @wenthold, this works great and thank you for the explanation.&lt;/P&gt;

&lt;P&gt;If you change this to an answer I can accept it.&lt;/P&gt;

&lt;P&gt;Kind Regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 07:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-to-Extract-Specific-Word/m-p/358967#M106107</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-01-02T07:05:23Z</dc:date>
    </item>
  </channel>
</rss>

