<?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 How to return a url only to the 2nd slash? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-a-url-only-to-the-2nd-slash/m-p/653278#M225770</link>
    <description>&lt;P&gt;So, this PCRE regex works in testers, but not on Splunk.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;^((http[s]?):\/)?\/?([^:\/\s]+)((\w+)*\/){2})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should return &lt;STRONG&gt;&lt;A href="https://someurl.com/first/" target="_blank" rel="noopener"&gt;https://someurl.com/first/&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;BUT in Splunk search, this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;rex field=referer "referer=(?&amp;lt;referer&amp;gt;^((http[s]?):\/)?\/?([^:\/\s]+)((\w+)*\/){2})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is returning the entire url, i.e.,&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://someurl.com/first/second/third/fourth/etc" target="_blank" rel="noopener"&gt;https://someurl.com/first/second/third/fourth/etc&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;What's the proper way to get what I'm looking for? Confused that this works in testers but not Splunk.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2023 19:13:32 GMT</pubDate>
    <dc:creator>isxtn</dc:creator>
    <dc:date>2023-08-07T19:13:32Z</dc:date>
    <item>
      <title>How to return a url only to the 2nd slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-a-url-only-to-the-2nd-slash/m-p/653278#M225770</link>
      <description>&lt;P&gt;So, this PCRE regex works in testers, but not on Splunk.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;^((http[s]?):\/)?\/?([^:\/\s]+)((\w+)*\/){2})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should return &lt;STRONG&gt;&lt;A href="https://someurl.com/first/" target="_blank" rel="noopener"&gt;https://someurl.com/first/&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;BUT in Splunk search, this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;rex field=referer "referer=(?&amp;lt;referer&amp;gt;^((http[s]?):\/)?\/?([^:\/\s]+)((\w+)*\/){2})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is returning the entire url, i.e.,&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://someurl.com/first/second/third/fourth/etc" target="_blank" rel="noopener"&gt;https://someurl.com/first/second/third/fourth/etc&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;What's the proper way to get what I'm looking for? Confused that this works in testers but not Splunk.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 19:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-a-url-only-to-the-2nd-slash/m-p/653278#M225770</guid>
      <dc:creator>isxtn</dc:creator>
      <dc:date>2023-08-07T19:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a url only to the 2nd slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-a-url-only-to-the-2nd-slash/m-p/653283#M225772</link>
      <description>&lt;P&gt;Just count 4 /&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval url="https://someurl.com/first/second/third/fourth/etc"
| rex field=url "(?&amp;lt;test&amp;gt;^(?:[^\/]*\/){4})"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Aug 2023 21:25:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-a-url-only-to-the-2nd-slash/m-p/653283#M225772</guid>
      <dc:creator>jotne</dc:creator>
      <dc:date>2023-08-04T21:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a url only to the 2nd slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-a-url-only-to-the-2nd-slash/m-p/653284#M225773</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 21:36:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-a-url-only-to-the-2nd-slash/m-p/653284#M225773</guid>
      <dc:creator>isxtn</dc:creator>
      <dc:date>2023-08-04T21:36:00Z</dc:date>
    </item>
  </channel>
</rss>

