<?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: Extracting domain names (mvindex?) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-domain-names-mvindex/m-p/26917#M4478</link>
    <description>&lt;P&gt;There are apps for this:&lt;/P&gt;

&lt;P&gt;URL Parser: &lt;A href="https://splunkbase.splunk.com/app/1545/"&gt;https://splunkbase.splunk.com/app/1545/&lt;/A&gt;&lt;BR /&gt;
URL Toolbox: &lt;A href="https://splunkbase.splunk.com/app/2734/"&gt;https://splunkbase.splunk.com/app/2734/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 05 Jul 2015 14:00:51 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-07-05T14:00:51Z</dc:date>
    <item>
      <title>Extracting domain names (mvindex?)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-domain-names-mvindex/m-p/26916#M4477</link>
      <description>&lt;P&gt;I get the feeling this is going to be a tough one to solve, but, I'm trying to aggregate results of a search based upon domain name.   I realise that this is a bit of a non-starter simply because of things like fubar.com versus fubar.co.uk, but, my first approach to this was:&lt;/P&gt;

&lt;PRE&gt;
search term | eval mydomain=split(dest_host,".") | eval tld=mvindex(mydomain,-1) | eval target=mvindex(mydomain,1) | eval hoster=target.".".tld 
&lt;/PRE&gt;

&lt;P&gt;And this works most of the time, but not all of the time.&lt;/P&gt;

&lt;P&gt;I'm operating on the (questionable) assumption that the last two elements split by dest_host are likely to be the domain name - but maybe there's a better way to perform this aggregation.  I'm trying to group together results which might be for host123-ab.fubar.com and host445-qx.fubar.com under fubar.com, for example.&lt;/P&gt;

&lt;P&gt;I suppose another way to do this is to use some sort of a lookup table with all well-known TLDs and major sub-domains (.co.uk, .ac.uk and so forth) -- but it feels like a problem others must have tried to resolve here already.&lt;/P&gt;

&lt;P&gt;Suggestions welcome!&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2012 05:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-domain-names-mvindex/m-p/26916#M4477</guid>
      <dc:creator>howyagoin</dc:creator>
      <dc:date>2012-04-14T05:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting domain names (mvindex?)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-domain-names-mvindex/m-p/26917#M4478</link>
      <description>&lt;P&gt;There are apps for this:&lt;/P&gt;

&lt;P&gt;URL Parser: &lt;A href="https://splunkbase.splunk.com/app/1545/"&gt;https://splunkbase.splunk.com/app/1545/&lt;/A&gt;&lt;BR /&gt;
URL Toolbox: &lt;A href="https://splunkbase.splunk.com/app/2734/"&gt;https://splunkbase.splunk.com/app/2734/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2015 14:00:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-domain-names-mvindex/m-p/26917#M4478</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-05T14:00:51Z</dc:date>
    </item>
  </channel>
</rss>

