<?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 edit my regular expression to extract URI from URL? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-URI-from-URL/m-p/245590#M73195</link>
    <description>&lt;P&gt;Give these a try (remove head command after testing)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=cowrie url=* | head 100 | table url| rex field=url "\/(?&amp;lt;uri&amp;gt;\w+\.\w+)$" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=cowrie url=* | head 100 | table url| rex field=url "^\w+:\/\/[^\/]+\/(?&amp;lt;uri&amp;gt;.+)$" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 22 Jan 2017 20:46:38 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-01-22T20:46:38Z</dc:date>
    <item>
      <title>How to edit my regular expression to extract URI from URL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-URI-from-URL/m-p/245589#M73194</link>
      <description>&lt;P&gt;Hey folks, sorry for asking this type of regex question yet again.&lt;/P&gt;

&lt;P&gt;I have values like this in a field called "url":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="http://8.8.8.8/file.sh" target="test_blank"&gt;http://8.8.8.8/file.sh&lt;/A&gt;
&lt;A href="http://1.1.1.1/file2.sh" target="test_blank"&gt;http://1.1.1.1/file2.sh&lt;/A&gt;
&lt;A href="http://8.8.4.4/file3.sh" target="test_blank"&gt;http://8.8.4.4/file3.sh&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to use rex to grab just the URI following the last " / " so I end up with a list like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;file.sh
file2.sh
file3.sh
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was trying to accomplish this using  &lt;CODE&gt;source=cowrie url=* | rex field=uri "\/(?&amp;lt;url&amp;gt;\w+)\s" | table uri&lt;/CODE&gt;   but I'm 99% sure my regular expression is wrong.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jan 2017 20:07:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-URI-from-URL/m-p/245589#M73194</guid>
      <dc:creator>xxdesmus</dc:creator>
      <dc:date>2017-01-22T20:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract URI from URL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-URI-from-URL/m-p/245590#M73195</link>
      <description>&lt;P&gt;Give these a try (remove head command after testing)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=cowrie url=* | head 100 | table url| rex field=url "\/(?&amp;lt;uri&amp;gt;\w+\.\w+)$" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=cowrie url=* | head 100 | table url| rex field=url "^\w+:\/\/[^\/]+\/(?&amp;lt;uri&amp;gt;.+)$" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Jan 2017 20:46:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-URI-from-URL/m-p/245590#M73195</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-22T20:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract URI from URL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-URI-from-URL/m-p/245591#M73196</link>
      <description>&lt;P&gt;You are a genius. Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jan 2017 20:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-URI-from-URL/m-p/245591#M73196</guid>
      <dc:creator>xxdesmus</dc:creator>
      <dc:date>2017-01-22T20:55:34Z</dc:date>
    </item>
  </channel>
</rss>

