<?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: Need help with a complicated field-extraction via regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295145#M89086</link>
    <description>&lt;P&gt;This worked for me (validated using regex101.com):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)Node ID=(nbg)?(?P&amp;lt;thing&amp;gt;\w+)cxm\d+
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Nov 2017 19:49:05 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2017-11-23T19:49:05Z</dc:date>
    <item>
      <title>Need help with a complicated field-extraction via regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295143#M89084</link>
      <description>&lt;P&gt;want to extract a field in splunk however Splunk Regex won't work so I am writing my own Regex. However I am struggling to extract. Can someone please help?&lt;/P&gt;

&lt;P&gt;My String:&lt;/P&gt;

&lt;P&gt;Node ID=nbgcXYZdfdscxm2&lt;BR /&gt;
Node ID=NBGDFDFCCXM2&lt;BR /&gt;
Node ID=BURECXM2&lt;/P&gt;

&lt;P&gt;Expected Output:&lt;/P&gt;

&lt;P&gt;cXYZdfds&lt;BR /&gt;
DFDFC&lt;BR /&gt;
BURE&lt;/P&gt;

&lt;P&gt;So far I was able to write this .*(?i)Node ID=&lt;A href="https://community.splunk.com/?P%5B%5E%5Dcxmd%5D+"&gt;^nbg&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 18:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295143#M89084</guid>
      <dc:creator>AnujaJadhav2</dc:creator>
      <dc:date>2017-11-23T18:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a complicated field-extraction via regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295144#M89085</link>
      <description>&lt;P&gt;Hi AnujaJadhav2,&lt;/P&gt;

&lt;P&gt;using regex101.com I ended up with this &lt;CODE&gt;or&lt;/CODE&gt; regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Node ID=(?i:(nbg))(.+)(?i:(cxm\d))|Node ID=(.+)(?i:(cxm\d))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the capturing group &lt;CODE&gt;(.+)&lt;/CODE&gt; gives you the required results.&lt;/P&gt;

&lt;P&gt;I'm sure this is not the best solution regex wise and some more clever guys haver better regexes, but it gives you something to start with &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 19:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295144#M89085</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-11-23T19:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a complicated field-extraction via regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295145#M89086</link>
      <description>&lt;P&gt;This worked for me (validated using regex101.com):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)Node ID=(nbg)?(?P&amp;lt;thing&amp;gt;\w+)cxm\d+
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Nov 2017 19:49:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295145#M89086</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-11-23T19:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a complicated field-extraction via regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295146#M89087</link>
      <description>&lt;P&gt;This works very well in regex101 but it needs a capturing group for extraction. Nevertheless, thank you so much for your help. &lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 09:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295146#M89087</guid>
      <dc:creator>AnujaJadhav2</dc:creator>
      <dc:date>2017-11-24T09:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a complicated field-extraction via regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295147#M89088</link>
      <description>&lt;P&gt;Just Perfect. Cannot imagine I wasted hours around this. Thank you so much. &lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 09:13:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-a-complicated-field-extraction-via-regex/m-p/295147#M89088</guid>
      <dc:creator>AnujaJadhav2</dc:creator>
      <dc:date>2017-11-24T09:13:52Z</dc:date>
    </item>
  </channel>
</rss>

