<?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 trim base domain from url in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381330#M68779</link>
    <description>&lt;P&gt;There are a few ways to do that.  The URL Toolbox app adds custom commands that will parse URLs.  There's also the URL Parser app, but I have no experience with it.&lt;/P&gt;

&lt;P&gt;If your data is not too complex, you can also parse it yourself using the &lt;CODE&gt;rex&lt;/CODE&gt; command.  This puts the domain.com part into the 'domain' field, but may need to be adjusted to suit your real data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex ".*?\.(?&amp;lt;domain&amp;gt;.*)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 08 Jul 2019 22:52:11 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-07-08T22:52:11Z</dc:date>
    <item>
      <title>How to trim base domain from url</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381329#M68778</link>
      <description>&lt;P&gt;I have several pieces of data that look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;subdomain1.domain.com
subdomain2.domain.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Question is how do I only pull the &lt;EM&gt;domain.com&lt;/EM&gt; part in a Splunk search?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 20:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381329#M68778</guid>
      <dc:creator>jgrantham</dc:creator>
      <dc:date>2019-07-08T20:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim base domain from url</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381330#M68779</link>
      <description>&lt;P&gt;There are a few ways to do that.  The URL Toolbox app adds custom commands that will parse URLs.  There's also the URL Parser app, but I have no experience with it.&lt;/P&gt;

&lt;P&gt;If your data is not too complex, you can also parse it yourself using the &lt;CODE&gt;rex&lt;/CODE&gt; command.  This puts the domain.com part into the 'domain' field, but may need to be adjusted to suit your real data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex ".*?\.(?&amp;lt;domain&amp;gt;.*)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 22:52:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381330#M68779</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-08T22:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim base domain from url</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381331#M68780</link>
      <description>&lt;P&gt;Here is what I am using:&lt;/P&gt;

&lt;P&gt;| rex field=dest_host".&lt;EM&gt;?.(?.&lt;/EM&gt;)"&lt;BR /&gt;
|table domain&lt;/P&gt;

&lt;P&gt;What am I doing wrong?  dest_host contains data like &lt;A href="http://www"&gt;www&lt;/A&gt;. domain.com or sub.domain.com.  I want to pull a count of domain.com.  I am new to splunk and can't figure this out.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381331#M68780</guid>
      <dc:creator>jgrantham</dc:creator>
      <dc:date>2019-07-09T12:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim base domain from url</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381332#M68781</link>
      <description>&lt;P&gt;Please edit your comment to indent the SPL at least 4 spaces so the SPL is preserved.  Tell us what you get from the SPL and what you expected to see.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:16:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381332#M68781</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-09T12:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim base domain from url</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381333#M68782</link>
      <description>&lt;P&gt;Ok.  I am running a query where one of the fields is dest_host.  This will bring back results like &lt;A href="http://www.domain.com" target="_blank"&gt;www.domain.com&lt;/A&gt;, sub.domain.com, sub1.domain.com. I am trying to get a count based on the total using everything that includes domain.com.  I currently have to do this manually and it is a pain.&lt;/P&gt;

&lt;P&gt;Here is the SPL:&lt;BR /&gt;
        index=us_cseo_prod_webproxy sourcetype=mcafee:wg:kv action_name=allow policydecidingaccess="Allow Hosts in Global Whitelist - Telephone Directories" &lt;BR /&gt;
|  table user dest&lt;BR /&gt;
|  stats count by dest&lt;/P&gt;

&lt;P&gt;What I get is a table with the following:&lt;BR /&gt;
        dest    count&lt;BR /&gt;
1   static.yellowpages.ca   19&lt;BR /&gt;
2   &lt;A href="http://www.yellowpages.ca" target="_blank"&gt;www.yellowpages.ca&lt;/A&gt;  2&lt;/P&gt;

&lt;P&gt;What I would like to see is :&lt;BR /&gt;
yellowpages.ca 21&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:15:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381333#M68782</guid>
      <dc:creator>jgrantham</dc:creator>
      <dc:date>2020-09-30T01:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim base domain from url</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381334#M68783</link>
      <description>&lt;P&gt;Here is what I am using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index=us_cseo_prod_webproxy sourcetype=mcafee:wg:kv action_name=allow policydecidingaccess="Allow Hosts in Global Whitelist - Telephone Directories" |  table user dest|  stats count by dest
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is what I get back:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;dest    count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1   static.yellowpages.ca   19&lt;BR /&gt;
2   &lt;A href="http://www.yellowpages.ca"&gt;www.yellowpages.ca&lt;/A&gt;  2&lt;/P&gt;

&lt;P&gt;Here is what I would like to see:&lt;/P&gt;

&lt;P&gt;dest                     count&lt;BR /&gt;
yellowpages.ca     21&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:59:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381334#M68783</guid>
      <dc:creator>jgrantham</dc:creator>
      <dc:date>2019-07-09T12:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim base domain from url</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381335#M68784</link>
      <description>&lt;P&gt;Finally got it to work.  Here is what I came up with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     index=us_cseo_prod_webproxy sourcetype=mcafee:wg:kv action_name=allow policydecidingaccess="Allow Hosts in Global Whitelist - Telephone Directories" | rex field=dest_host "\.(?&amp;lt;domainname&amp;gt;\S+.\S+)$" |table domainname | stats count by domainname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    domainname  count
   whitepages.com   2
    yellowpages.ca  21
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:59:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-trim-base-domain-from-url/m-p/381335#M68784</guid>
      <dc:creator>jgrantham</dc:creator>
      <dc:date>2019-07-09T13:59:45Z</dc:date>
    </item>
  </channel>
</rss>

