<?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: Help to extract fields from the URL in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501654#M139668</link>
    <description>&lt;P&gt;@maria_n &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH | rex field=MESSAGE " Endpoint=http:\/\/(?&amp;lt;namespace&amp;gt;.*)-oic-(?&amp;lt;service&amp;gt;.*\.com)" 
| table namespace service MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval MESSAGE="MESSAGE: 2019-12-05 04:04:42, Environment=OIC STRESS B, Service=, Status=000, Response_Time=0.000, Endpoint=http://internal-blue-ocf-oic-stress-b.aps.gc1-b.lle.ocf.xxx.com/oic/" 
| rex field=MESSAGE " Endpoint=http:\/\/(?&amp;lt;namespace&amp;gt;.*)-oic-(?&amp;lt;service&amp;gt;.*\.com)" 
| table namespace service MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2019 10:51:53 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-12-05T10:51:53Z</dc:date>
    <item>
      <title>Help to extract fields from the URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501652#M139666</link>
      <description>&lt;P&gt;I need to extract "internal-blue-ocf" as &lt;STRONG&gt;namespace&lt;/STRONG&gt; and  "stress-b.aps.gc1-b.lle.ocf.xxx.com" as &lt;STRONG&gt;service&lt;/STRONG&gt; using rex from the below data.&lt;BR /&gt;
The condition for the fields should be like,&lt;BR /&gt;
1) namespace: content between http:// and -oic&lt;BR /&gt;
2) service: content should start after oic- and ends at .com&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;MESSAGE: 2019-12-05 04:04:42, Environment=OIC STRESS B, Service=, Status=000, Response_Time=0.000, Endpoint=http://internal-blue-ocf-oic-stress-b.aps.gc1-b.lle.ocf.xxx.com/oic/&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The rex should be used on field called MESSAGE. Please help!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 10:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501652#M139666</guid>
      <dc:creator>maria_n</dc:creator>
      <dc:date>2019-12-05T10:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help to extract fields from the URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501653#M139667</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval MESSAGE="MESSAGE: 2019-12-05 04:04:42, Environment=OIC STRESS B, Service=, Status=000, Response_Time=0.000, Endpoint=http://internal-blue-ocf-oic-stress-b.aps.gc1-b.lle.ocf.xxx.com/oic/" 
| rex field=MESSAGE "Endpoint=http:\/\/(?P&amp;lt;namespace&amp;gt;.+)-oic-(?P&amp;lt;service&amp;gt;.+.com)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Dec 2019 10:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501653#M139667</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-12-05T10:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help to extract fields from the URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501654#M139668</link>
      <description>&lt;P&gt;@maria_n &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH | rex field=MESSAGE " Endpoint=http:\/\/(?&amp;lt;namespace&amp;gt;.*)-oic-(?&amp;lt;service&amp;gt;.*\.com)" 
| table namespace service MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval MESSAGE="MESSAGE: 2019-12-05 04:04:42, Environment=OIC STRESS B, Service=, Status=000, Response_Time=0.000, Endpoint=http://internal-blue-ocf-oic-stress-b.aps.gc1-b.lle.ocf.xxx.com/oic/" 
| rex field=MESSAGE " Endpoint=http:\/\/(?&amp;lt;namespace&amp;gt;.*)-oic-(?&amp;lt;service&amp;gt;.*\.com)" 
| table namespace service MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 10:51:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501654#M139668</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-12-05T10:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help to extract fields from the URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501655#M139669</link>
      <description>&lt;P&gt;Please try the below&lt;BR /&gt;
 | rex field=_raw "http:..(?P\w+-\w+-\w+)-oic-(?P.*.com)"&lt;/P&gt;

&lt;P&gt;If the data look likes above, this regex will work. But the data contains numbers in between word. We need to write different regex.&lt;BR /&gt;
Kindly let me know if it works.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 11:19:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501655#M139669</guid>
      <dc:creator>kartm2020</dc:creator>
      <dc:date>2019-12-05T11:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help to extract fields from the URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501656#M139670</link>
      <description>&lt;P&gt;Thanks @vnravikumar  and @kamlesh_vaghela. It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 11:25:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501656#M139670</guid>
      <dc:creator>maria_n</dc:creator>
      <dc:date>2019-12-05T11:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help to extract fields from the URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501657#M139671</link>
      <description>&lt;P&gt;Sorry, this didn't work @kartm. The above ones shared by kamlesh and ravikumar worked for me. Thanks anyway &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 11:28:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-extract-fields-from-the-URL/m-p/501657#M139671</guid>
      <dc:creator>maria_n</dc:creator>
      <dc:date>2019-12-05T11:28:21Z</dc:date>
    </item>
  </channel>
</rss>

