<?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 write a regular expression to extract the domain name from dest_host field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352409#M104307</link>
    <description>&lt;P&gt;I tried, its not working&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2017 14:30:32 GMT</pubDate>
    <dc:creator>kiran331</dc:creator>
    <dc:date>2017-03-13T14:30:32Z</dc:date>
    <item>
      <title>How to write a regular expression to extract the domain name from dest_host field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352407#M104305</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;How to write a regular expression to use to extract the domain name from the dest_host, like extracting the last character before second "."&lt;BR /&gt;
for example:&lt;BR /&gt;
stg-ec-ore-u.uplynk.com &lt;BR /&gt;
7.tlu.dl.delivery.mp.microsoft.com&lt;BR /&gt;&lt;BR /&gt;
stg-ec-norcal-u.microsoft.com&lt;BR /&gt;&lt;BR /&gt;
foxnews-f.akamaihd.net&lt;BR /&gt;&lt;BR /&gt;
cnnios-f.akamaihd.net&lt;BR /&gt;&lt;BR /&gt;
daarack02.vpg.cdn.yimg.com&lt;BR /&gt;&lt;BR /&gt;
redir.adap.tv&lt;/P&gt;

&lt;P&gt;Required Output:&lt;BR /&gt;
.uplynk.com &lt;BR /&gt;
.microsoft.com&lt;BR /&gt;&lt;BR /&gt;
.akamaihd.net&lt;BR /&gt;&lt;BR /&gt;
.yimg.com&lt;BR /&gt;
.adap.tv&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:17:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352407#M104305</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-03-13T14:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a regular expression to extract the domain name from dest_host field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352408#M104306</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | rex field=dest_host "(?&amp;lt;domain&amp;gt;\.[A-z0-9]+\.[A-z0-9]+)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352408#M104306</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-13T14:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a regular expression to extract the domain name from dest_host field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352409#M104307</link>
      <description>&lt;P&gt;I tried, its not working&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352409#M104307</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-03-13T14:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a regular expression to extract the domain name from dest_host field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352410#M104308</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=dest_host "[^\.]+(?&amp;lt;domain&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352410#M104308</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2017-03-13T14:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a regular expression to extract the domain name from dest_host field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352411#M104309</link>
      <description>&lt;P&gt;Missed a + sign at the end. Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352411#M104309</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-13T14:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a regular expression to extract the domain name from dest_host field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352412#M104310</link>
      <description>&lt;P&gt;Thanks somesoni2! It worked, is there a way to remove . before domain name.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:57:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352412#M104310</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-03-13T14:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a regular expression to extract the domain name from dest_host field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352413#M104311</link>
      <description>&lt;P&gt;Just remove the &lt;CODE&gt;\.&lt;/CODE&gt; after &lt;CODE&gt;&amp;lt;domain&amp;gt;&lt;/CODE&gt;. A more accurate version would be like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | rex field=dest_host "\.(?&amp;lt;domain&amp;gt;[A-z0-9]+\.[A-z0-9]+)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Mar 2017 15:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-the-domain-name/m-p/352413#M104311</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-13T15:06:31Z</dc:date>
    </item>
  </channel>
</rss>

