<?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 extract uri in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/extract-uri/m-p/493716#M137679</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;/hk-zh/shop/buy-phone/phone-1/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-256gb-%E9%8A%80%E8%89%B2 1059
/hk/shop/buy-phone/phoneSS/5.5-inch-display-128gb-rose-gold 493
/hk-zh/shop/buy-phone/one6/5.5-%E5%90%8B%E8%9E%A2%E5%B9%95-128gb-%E7%8E%AB%E7%91%B0%E9%87%91%E8%89%B2   375
/shop/buy-tab/mini-3/128gb-gold-wifi    90
/shop/buy-tab/mini-3/128gb-silver-wifi  90
/hk-zh/shop/buy-phone/phone-sm/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-64gb-%E9%8A%80%E8%89%B2 60
/hk-zh/shop/buy-phone/phone-ap/5.5-%E5%90%8B%E8%9E%A2%E5%B9%95-128gb-%E4%BA%AE%E9%BB%91%E8%89%B2    59
/hk-zh/shop/buy-phone/phone-lg/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-64gb-%E5%A4%AA%E7%A9%BA%E7%81%B0    59
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract URL starting from /shop/.....    till special char like %E5 something.&lt;BR /&gt;
Something like this.&lt;BR /&gt;
/shop/buy-phone/phone-1/5.8&lt;BR /&gt;
/shop/buy-phone/phoneSS/5.5-inch-display-128gb-rose-gold&lt;BR /&gt;
/shop/buy-phone/one6/5.5&lt;BR /&gt;
/shop/buy-tab/mini-3/128gb-gold-wifi&lt;BR /&gt;
/shop/buy-tab/mini-3/128gb-silver-wifi&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2019 19:36:58 GMT</pubDate>
    <dc:creator>sandeepmakkena</dc:creator>
    <dc:date>2019-10-07T19:36:58Z</dc:date>
    <item>
      <title>extract uri</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-uri/m-p/493716#M137679</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;/hk-zh/shop/buy-phone/phone-1/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-256gb-%E9%8A%80%E8%89%B2 1059
/hk/shop/buy-phone/phoneSS/5.5-inch-display-128gb-rose-gold 493
/hk-zh/shop/buy-phone/one6/5.5-%E5%90%8B%E8%9E%A2%E5%B9%95-128gb-%E7%8E%AB%E7%91%B0%E9%87%91%E8%89%B2   375
/shop/buy-tab/mini-3/128gb-gold-wifi    90
/shop/buy-tab/mini-3/128gb-silver-wifi  90
/hk-zh/shop/buy-phone/phone-sm/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-64gb-%E9%8A%80%E8%89%B2 60
/hk-zh/shop/buy-phone/phone-ap/5.5-%E5%90%8B%E8%9E%A2%E5%B9%95-128gb-%E4%BA%AE%E9%BB%91%E8%89%B2    59
/hk-zh/shop/buy-phone/phone-lg/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-64gb-%E5%A4%AA%E7%A9%BA%E7%81%B0    59
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract URL starting from /shop/.....    till special char like %E5 something.&lt;BR /&gt;
Something like this.&lt;BR /&gt;
/shop/buy-phone/phone-1/5.8&lt;BR /&gt;
/shop/buy-phone/phoneSS/5.5-inch-display-128gb-rose-gold&lt;BR /&gt;
/shop/buy-phone/one6/5.5&lt;BR /&gt;
/shop/buy-tab/mini-3/128gb-gold-wifi&lt;BR /&gt;
/shop/buy-tab/mini-3/128gb-silver-wifi&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 19:36:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-uri/m-p/493716#M137679</guid>
      <dc:creator>sandeepmakkena</dc:creator>
      <dc:date>2019-10-07T19:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: extract uri</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-uri/m-p/493717#M137680</link>
      <description>&lt;P&gt;Try the below run anywhere search, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval url=split(("/hk-zh/shop/buy-phone/phone-1/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-256gb-%E9%8A%80%E8%89%B2    1059,
/hk/shop/buy-phone/phoneSS/5.5-inch-display-128gb-rose-gold    493,
/hk-zh/shop/buy-phone/one6/5.5-%E5%90%8B%E8%9E%A2%E5%B9%95-128gb-%E7%8E%AB%E7%91%B0%E9%87%91%E8%89%B2    375,
/shop/buy-tab/mini-3/128gb-gold-wifi    90,
/shop/buy-tab/mini-3/128gb-silver-wifi    90,
/hk-zh/shop/buy-phone/phone-sm/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-64gb-%E9%8A%80%E8%89%B2    60,
/hk-zh/shop/buy-phone/phone-ap/5.5-%E5%90%8B%E8%9E%A2%E5%B9%95-128gb-%E4%BA%AE%E9%BB%91%E8%89%B2    59,
/hk-zh/shop/buy-phone/phone-lg/5.8-%E5%90%8B%E9%A1%AF%E7%A4%BA%E5%99%A8-64gb-%E5%A4%AA%E7%A9%BA%E7%81%B0    59"),",")
|mvexpand url
| eval decoded_url=urldecode(url)
| rex field=url "shop(?&amp;lt;ex_url&amp;gt;[a-zA-Z\/\-0-9\.]+)"
| rex field=ex_url mode=sed "s/-$//g"
| eval ex_url="/shop"+ex_url
| table url, decoded_url, ex_url
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;url- actual url from samples&lt;BR /&gt;
decoded_url - decoded url using urldecode function. &lt;BR /&gt;
ex_url - is the extracted url.&lt;/P&gt;

&lt;P&gt;Hope this helps you.. &lt;/P&gt;

&lt;P&gt;Cheers !!!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-uri/m-p/493717#M137680</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2020-09-30T02:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: extract uri</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-uri/m-p/493718#M137681</link>
      <description>&lt;P&gt;try something like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| your search | rex field=`some_field` "(?&amp;lt;=\/shop)(?&amp;lt;uri&amp;gt;[a-zA-Z-0-9.\/-]+)" | table uri
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Oct 2019 19:57:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-uri/m-p/493718#M137681</guid>
      <dc:creator>kiamco</dc:creator>
      <dc:date>2019-10-07T19:57:15Z</dc:date>
    </item>
  </channel>
</rss>

