<?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 search and find all sender email addresses that are similar, but not exact matches to any domain in a list? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260111#M77963</link>
    <description>&lt;P&gt;Before I accept your answer I need a bit more advice.&lt;/P&gt;

&lt;P&gt;Lets say I have  a large number of white list email domains (around 500K in my correct_domain.csv) that I need to check for variations in the sender values.&lt;/P&gt;

&lt;P&gt;Cluster seems to be rather resource expensive.  Is there a way to optimize the comparison?  Or another way to do this domain variation check?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2016 14:19:44 GMT</pubDate>
    <dc:creator>packet_hunter</dc:creator>
    <dc:date>2016-02-04T14:19:44Z</dc:date>
    <item>
      <title>How to search and find all sender email addresses that are similar, but not exact matches to any domain in a list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260108#M77960</link>
      <description>&lt;P&gt;Scenario:   I want to find all sender email addresses that are not exact matches to a list, but "similar" to any domain of the list (or contains any part of a domain on the list).&lt;/P&gt;

&lt;P&gt;For example:   Correct sender email domain could be &lt;A href="mailto:sender@company.com"&gt;sender@company.com&lt;/A&gt;, Incorrect sender email domain could be &lt;A href="mailto:sender@company.org"&gt;sender@company.org&lt;/A&gt;, or &lt;A href="mailto:sender@company-corp.net"&gt;sender@company-corp.net&lt;/A&gt;, or &lt;A href="mailto:sender@companycorporation.us"&gt;sender@companycorporation.us&lt;/A&gt;, etc...&lt;BR /&gt;
Sample code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mail sourcetype=xemail
[search index=mail sourcetype=xemail subject = "Blah" |stats count by UID| fields UID] 
|stats list(subject) as subj list(sender) as sender list(recipient) as recp by UID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please provide an example using correct_domain.csv as the good domain list.   &lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 20:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260108#M77960</guid>
      <dc:creator>packet_hunter</dc:creator>
      <dc:date>2016-02-01T20:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and find all sender email addresses that are similar, but not exact matches to any domain in a list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260109#M77961</link>
      <description>&lt;P&gt;Have you considered using the &lt;CODE&gt;cluster&lt;/CODE&gt; command? You can use &lt;CODE&gt;match=ngramset&lt;/CODE&gt; to look at subcomponents of the domain, then tweak the &lt;CODE&gt;t&lt;/CODE&gt; threshold value to make the clusters more / less similar. Ideally you want to do some fuzzy matching which IDK how to do in Splunk. The nice thing about using cluster is that it is looking at 3-character substrings. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mail sourcetype=xemail
 [search index=mail sourcetype=xemail subject = "Blah" |stats count by UID| fields UID] 
|stats count by sender subject recipient UID
| cluster field=sender match=ngramset labelonly=t t=0.8
| stats values(sender) by cluster_label
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is an example of using it with a list of email addresses, where cluster correctly groups domains that contain yahoo (even if they end  in a different TLD):&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1019i1CA88214016ECFB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 22:14:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260109#M77961</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-02-01T22:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and find all sender email addresses that are similar, but not exact matches to any domain in a list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260110#M77962</link>
      <description>&lt;P&gt;Thanks I will give it a shot with cluster&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 22:28:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260110#M77962</guid>
      <dc:creator>packet_hunter</dc:creator>
      <dc:date>2016-02-01T22:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and find all sender email addresses that are similar, but not exact matches to any domain in a list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260111#M77963</link>
      <description>&lt;P&gt;Before I accept your answer I need a bit more advice.&lt;/P&gt;

&lt;P&gt;Lets say I have  a large number of white list email domains (around 500K in my correct_domain.csv) that I need to check for variations in the sender values.&lt;/P&gt;

&lt;P&gt;Cluster seems to be rather resource expensive.  Is there a way to optimize the comparison?  Or another way to do this domain variation check?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:19:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260111#M77963</guid>
      <dc:creator>packet_hunter</dc:creator>
      <dc:date>2016-02-04T14:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and find all sender email addresses that are similar, but not exact matches to any domain in a list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260112#M77964</link>
      <description>&lt;P&gt;Make sure you are clustering on the smallest possible table on the smallest subset of data that you can manage. The &lt;CODE&gt;cluster&lt;/CODE&gt; command does not have any memory/resource control options.&lt;/P&gt;

&lt;P&gt;If you do not want to use cluster, the next best option would be to use a custom python command. There is one already written and explained &lt;A href="https://answers.splunk.com/answers/5927/can-splunk-compare-two-strings-and-return-likeness-similarity-between-the-two.html"&gt;here&lt;/A&gt;. Best of luck. &lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 21:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260112#M77964</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-02-04T21:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and find all sender email addresses that are similar, but not exact matches to any domain in a list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260113#M77965</link>
      <description>&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 14:48:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-find-all-sender-email-addresses-that-are/m-p/260113#M77965</guid>
      <dc:creator>packet_hunter</dc:creator>
      <dc:date>2016-02-05T14:48:56Z</dc:date>
    </item>
  </channel>
</rss>

