<?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 do I write the regular expression to extract the domain name from email addresses in SMTP logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218543#M64227</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | eval sender_domain=mvindex(split(sender,"@"),-1) .....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | rex field=sender ".*@(?&amp;lt;sender_domain&amp;gt;.*)" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Jan 2016 19:38:20 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-01-08T19:38:20Z</dc:date>
    <item>
      <title>How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218542#M64226</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am really new to Splunk and Regular Expression stuff. I was planning to extract just the domain names of all e-mail senders in my SMTP Log. For example, If the sender field value is &lt;CODE&gt;store_news @amazon.com&lt;/CODE&gt;, then I just want to extract the domain name which is &lt;CODE&gt;amazon.com&lt;/CODE&gt;. Can somebody please provide me a way to perform this?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Appreciated&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 19:28:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218542#M64226</guid>
      <dc:creator>jspvkey</dc:creator>
      <dc:date>2016-01-08T19:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218543#M64227</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | eval sender_domain=mvindex(split(sender,"@"),-1) .....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | rex field=sender ".*@(?&amp;lt;sender_domain&amp;gt;.*)" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jan 2016 19:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218543#M64227</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-08T19:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218544#M64228</link>
      <description>&lt;P&gt;If you are uncomfortable with regular expressions, you can use the Interactive Field Extractor. Documentation here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 19:43:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218544#M64228</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2016-01-08T19:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218545#M64229</link>
      <description>&lt;H3&gt;Learn Regex&lt;/H3&gt;

&lt;H4&gt;&lt;A href="http://regexone.com"&gt;http://regexone.com&lt;/A&gt;&lt;/H4&gt;

&lt;H4&gt;&lt;A href="http://www.regular-expressions.info/quickstart.html"&gt;http://www.regular-expressions.info/quickstart.html&lt;/A&gt;&lt;/H4&gt;

&lt;HR /&gt;

&lt;H2&gt;Search answers:&lt;/H2&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/338138/how-to-search-for-and-extract-email-ids-with-dot-t.html"&gt;https://answers.splunk.com/answers/338138/how-to-search-for-and-extract-email-ids-with-dot-t.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/190126/how-to-extract-only-the-top-level-domain-tld-from.html"&gt;https://answers.splunk.com/answers/190126/how-to-extract-only-the-top-level-domain-tld-from.html&lt;/A&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;H3&gt;Read about:&lt;/H3&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;field extractor&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;props.conf&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Knowledge/AboutSplunkregularexpressions"&gt;Splunk regular expressions&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 08 Jan 2016 19:43:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218545#M64229</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-01-08T19:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218546#M64230</link>
      <description>&lt;P&gt;Here is another one&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@(?\w+.\w{3})
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Jan 2016 06:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218546#M64230</guid>
      <dc:creator>mhassan</dc:creator>
      <dc:date>2016-01-10T06:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218547#M64231</link>
      <description>&lt;P&gt;This one won't work for all email addresses...&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 23:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218547#M64231</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-01-14T23:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218548#M64232</link>
      <description>&lt;P&gt;Based on your answer, I used the following to extract the domain part and sort by number of occurrences for the top 20:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval sender_domain=mvindex(split(sender,"@"),-1)  | top limit=20 sender_domain
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Sep 2019 08:14:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218548#M64232</guid>
      <dc:creator>thahn</dc:creator>
      <dc:date>2019-09-30T08:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write the regular expression to extract the domain name from email addresses in SMTP logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218549#M64233</link>
      <description>&lt;P&gt;Agreed, there are top level domains with shorter and longer lengths. Also the dot isn't escaped.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 09:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-the-regular-expression-to-extract-the-domain-name/m-p/218549#M64233</guid>
      <dc:creator>martynoconnor</dc:creator>
      <dc:date>2019-09-30T09:02:40Z</dc:date>
    </item>
  </channel>
</rss>

