<?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: Extract only host name from the URL field- in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Extract-only-host-name-from-the-URL-field/m-p/530165#M9476</link>
    <description>&lt;LI-CODE lang="markup"&gt;| rex field=blockURL "http(s):\/\/(?&amp;lt;hostname&amp;gt;[^\/]+)"
| eval result=coalesce(hostname,blockedURL)&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 20 Nov 2020 08:36:53 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2020-11-20T08:36:53Z</dc:date>
    <item>
      <title>Extract only host name from the URL field-</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Extract-only-host-name-from-the-URL-field/m-p/530160#M9475</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a field "blockedUri" which can contain two types of value (string or URL). Below is an example :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;blockedUri = eval&lt;/P&gt;&lt;P&gt;blockedUri = &lt;A href="https://analytics.google.com/sample.js" target="_blank" rel="noopener"&gt;https://analytics.google.com/sample.js&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a splunk search query that will trim and return the only hostname of the value if it's a URL or if it is a normal string simply return the string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result should be as below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eval&lt;/P&gt;&lt;P&gt;&lt;A href="https://analytics.google.com/sample.js" target="_blank" rel="noopener"&gt;analytics.google.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 08:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Extract-only-host-name-from-the-URL-field/m-p/530160#M9475</guid>
      <dc:creator>yat135</dc:creator>
      <dc:date>2020-11-20T08:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only host name from the URL field-</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Extract-only-host-name-from-the-URL-field/m-p/530165#M9476</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=blockURL "http(s):\/\/(?&amp;lt;hostname&amp;gt;[^\/]+)"
| eval result=coalesce(hostname,blockedURL)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Nov 2020 08:36:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Extract-only-host-name-from-the-URL-field/m-p/530165#M9476</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-20T08:36:53Z</dc:date>
    </item>
  </channel>
</rss>

