<?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: How to do a regex for break an url after the fourth slash? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598038#M208248</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search
| rex "^(https|http):(?&amp;lt;url&amp;gt;\/\/\w+\/\w+\/)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/4kTIF3/1" target="_blank"&gt;https://regex101.com/r/4kTIF3/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2022 06:37:12 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-05-17T06:37:12Z</dc:date>
    <item>
      <title>How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/597979#M208221</link>
      <description>&lt;P&gt;hello&lt;/P&gt;
&lt;P&gt;I try to do a regex for break an url after the fourth slash&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xxxx/yyyy" target="_blank" rel="noopener"&gt;https://xxxx/yyyy&lt;/A&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;test&lt;/P&gt;
&lt;P&gt;could you help please?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 17:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/597979#M208221</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-16T17:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/597980#M208222</link>
      <description>&lt;P&gt;It would have helped to know what you'd tried before so we wouldn't suggest the same expressions.&lt;/P&gt;&lt;P&gt;Have you tried&amp;nbsp;&lt;FONT face="courier new,courier"&gt;(?&amp;lt;field1&amp;gt;(?:.*?\/){4})(?&amp;lt;field2&amp;gt;.*)&lt;/FONT&gt; ?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 16:36:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/597980#M208222</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-05-16T16:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/597995#M208232</link>
      <description>&lt;P&gt;Depending on what you need, there may be other ways to accomplish this. Are you just trying to capture the final value, or would it always be after the 4th / even if there were more after it?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 19:40:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/597995#M208232</guid>
      <dc:creator>etoombs</dc:creator>
      <dc:date>2022-05-16T19:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598034#M208245</link>
      <description>&lt;P&gt;thanks it works but I would like to do the break in the same line, actually it's done on 2 lines&lt;/P&gt;&lt;P&gt;is it possible?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 06:20:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598034#M208245</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-17T06:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598035#M208246</link>
      <description>&lt;P&gt;Please explain what you mean by this, perhaps with some sample events and what your desired output would be?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 06:28:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598035#M208246</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-17T06:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598038#M208248</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search
| rex "^(https|http):(?&amp;lt;url&amp;gt;\/\/\w+\/\w+\/)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/4kTIF3/1" target="_blank"&gt;https://regex101.com/r/4kTIF3/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 06:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598038#M208248</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-17T06:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598040#M208249</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It's not my need&lt;/P&gt;&lt;P&gt;My need is dont to match the fourfth / but to break the URL after the fourfth / into a single line&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 07:27:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598040#M208249</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-17T07:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598042#M208250</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;my regex puts in the url field the url until the fourth slash, or, if you prefer, the second section of it.&lt;/P&gt;&lt;P&gt;If you want in the reduced url also http or https, you could use this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search
| rex "^(?&amp;lt;url&amp;gt;(https|http):\/\/\w+\/\w+\/)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 07:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598042#M208250</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-17T07:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598043#M208251</link>
      <description>&lt;P&gt;it doesnt works&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 07:39:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598043#M208251</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-17T07:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598044#M208252</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the regex works on regex101.com: &lt;A href="https://regex101.com/r/4kTIF3/2" target="_blank"&gt;https://regex101.com/r/4kTIF3/2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;could you share a sample of your logs?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 07:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598044#M208252</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-17T07:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a regex for break an url after the fourth slash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598045#M208253</link>
      <description>&lt;P&gt;It seems that the way you have phrased your question does not make it clear what it is you are trying to achieve - please can you give examples of the desired output so we might better be able to guide you to a solution?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 07:48:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598045#M208253</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-17T07:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598046#M208254</link>
      <description>&lt;P&gt;If the URL is&amp;nbsp;&lt;A href="https://xxxx/yyyy/test," target="_blank"&gt;https://xxxx/yyyy/test,&lt;/A&gt;&amp;nbsp;I need to display&lt;/P&gt;&lt;P&gt;&lt;A href="https://xxxx/yyyy" target="_blank"&gt;https://xxxx/yyyy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://xxxx/yyyy" target="_blank"&gt;/test&lt;/A&gt;&lt;/P&gt;&lt;P&gt;in the same line&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 07:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598046#M208254</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-17T07:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598048#M208255</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval url=replace(url,"(?&amp;lt;part1&amp;gt;\w+:(\/.*){4})(?&amp;lt;rest&amp;gt;.*)","\1
\2")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 May 2022 08:05:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598048#M208255</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-17T08:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598049#M208256</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand, you want two fields from your url:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;in the first "&lt;A href="https://xxxx/yyyy" target="_blank" rel="nofollow noopener noreferrer"&gt;https://xxxx/yyyy&lt;/A&gt;"&lt;/LI&gt;&lt;LI&gt;in the second "&lt;A href="https://xxxx/yyyy" target="_blank" rel="nofollow noopener noreferrer"&gt;/test&lt;/A&gt;"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if this is your need, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search
| rex "^(?&amp;lt;url1&amp;gt;(https|http):\/\/\w+\/\w+)(?&amp;lt;url2&amp;gt;\/[^ ]+)"&lt;/LI-CODE&gt;&lt;P&gt;if the url in another extracted field (called e.g. original_url), you could use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search
| rex field=original_url "^(?&amp;lt;url1&amp;gt;(https|http):\/\/\w+\/\w+)(?&amp;lt;url2&amp;gt;\/[^ ]+)"&lt;/LI-CODE&gt;&lt;P&gt;you can test the new regex at&amp;nbsp;&lt;A href="https://regex101.com/r/4kTIF3/3" target="_blank"&gt;https://regex101.com/r/4kTIF3/3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 08:06:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598049#M208256</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-17T08:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598051#M208257</link>
      <description>&lt;P&gt;it sounds like this but when I say that I want to cut after the fourfth /,&amp;nbsp; the double / after https have to be taken into account&lt;/P&gt;&lt;P&gt;so in my example, the cut has to be done just before / test&lt;/P&gt;&lt;P&gt;and other point, /test has to be cut and paste and not copy and paste&lt;/P&gt;&lt;P&gt;&lt;A href="https://xxxx/yyyy" target="_blank" rel="noopener nofollow noreferrer"&gt;https://xxxx/yyyy&lt;/A&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;SPAN&gt;test&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 08:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598051#M208257</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-17T08:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598052#M208258</link>
      <description>&lt;P&gt;always not good...&lt;/P&gt;&lt;P&gt;it breaks anything&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 08:24:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598052#M208258</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-17T08:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598055#M208260</link>
      <description>&lt;P&gt;Sorry, the double slash was messing with the result. Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval updated=replace(url,"(?&amp;lt;part1&amp;gt;\w+:\/\/[^\/]*\/[^\/]*)(?&amp;lt;rest&amp;gt;.*)","\1
\2")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 May 2022 08:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598055#M208260</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-17T08:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help on regex for breaking an url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598064#M208261</link>
      <description>&lt;P&gt;perfect ITWhisperer, many thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 09:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-regex-for-break-an-url-after-the-fourth-slash/m-p/598064#M208261</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-17T09:56:06Z</dc:date>
    </item>
  </channel>
</rss>

