<?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: Count of distinct values for emails in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493440#M194398</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="mail" 
| stats count dc(recipient) BY subject
| where count &amp;gt; 50
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Nov 2019 05:31:16 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-11-26T05:31:16Z</dc:date>
    <item>
      <title>Count of distinct values for emails</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493439#M194397</link>
      <description>&lt;P&gt;I have events coming in from an email spam appliance and would like to have an alert on spam campaigns with a unique sender,subject or content if they exceed a certain number (e.g. 50)&lt;/P&gt;

&lt;P&gt;I'm scratching my head trying to create a search to get a count of events with common value for the subject field as a start.&lt;/P&gt;

&lt;P&gt;index="mail" | stats dc(subject) as subjectcount | where subjectcount &amp;gt; 50&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 01:28:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493439#M194397</guid>
      <dc:creator>hattrells</dc:creator>
      <dc:date>2019-11-26T01:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count of distinct values for emails</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493440#M194398</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="mail" 
| stats count dc(recipient) BY subject
| where count &amp;gt; 50
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Nov 2019 05:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493440#M194398</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-26T05:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count of distinct values for emails</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493441#M194399</link>
      <description>&lt;P&gt;This was incredibly easy in the end.... your answer is pretty much what I was trying to get to, only I didn't want to see the count per recipient, only the overall count of distinct subject headers so:&lt;/P&gt;

&lt;P&gt;index="mail" | stats count by subject | search count&amp;gt;50&lt;/P&gt;

&lt;P&gt;Added an alert which is only triggered when the count is greater than 50 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 05:37:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493441#M194399</guid>
      <dc:creator>hattrells</dc:creator>
      <dc:date>2019-11-26T05:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count of distinct values for emails</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493442#M194400</link>
      <description>&lt;P&gt;I try to add a little bonus value where I can; sometimes I am off the mark.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 16:39:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-of-distinct-values-for-emails/m-p/493442#M194400</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-26T16:39:10Z</dc:date>
    </item>
  </channel>
</rss>

