<?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: Distinct Count on Summary Index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Distinct-Count-on-Summary-Index/m-p/39674#M9078</link>
    <description>&lt;P&gt;You have two choices here. In general, the arguments to &lt;CODE&gt;stats&lt;/CODE&gt; from a summary index populated by &lt;CODE&gt;sistats&lt;/CODE&gt; must be exactly the same, so the only valid search (prefix) is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="summary" search_name="" earliest="-1d@d" latest="0d@d" | stats count by email
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can find the distinct number of email values by adding &lt;CODE&gt;stats count&lt;/CODE&gt; to the search, which calculates the number of rows (distinct emails):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="summary" search_name="" earliest="-1d@d" latest="0d@d" | stats count by email | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternately, you could populate the summary index with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="blah" | sistats dc(email)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Aug 2010 23:12:31 GMT</pubDate>
    <dc:creator>Stephen_Sorkin</dc:creator>
    <dc:date>2010-08-30T23:12:31Z</dc:date>
    <item>
      <title>Distinct Count on Summary Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-Count-on-Summary-Index/m-p/39673#M9077</link>
      <description>&lt;P&gt;Okay, my summary index looks like this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;sourcetype="blah" | sistats count by email&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I'd like to run a query against the index to determine the distinct number of email addresses that appear during a specific time period, as in:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;index="summary" search_name="" earliest="-1d@d" latest="0d@d" | stats dc(email)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;But it's coming up blank.  Any thoughts?&lt;/P&gt;

&lt;P&gt;Thanks!
-S.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2010 22:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-Count-on-Summary-Index/m-p/39673#M9077</guid>
      <dc:creator>sondradotcom</dc:creator>
      <dc:date>2010-08-30T22:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count on Summary Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-Count-on-Summary-Index/m-p/39674#M9078</link>
      <description>&lt;P&gt;You have two choices here. In general, the arguments to &lt;CODE&gt;stats&lt;/CODE&gt; from a summary index populated by &lt;CODE&gt;sistats&lt;/CODE&gt; must be exactly the same, so the only valid search (prefix) is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="summary" search_name="" earliest="-1d@d" latest="0d@d" | stats count by email
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can find the distinct number of email values by adding &lt;CODE&gt;stats count&lt;/CODE&gt; to the search, which calculates the number of rows (distinct emails):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="summary" search_name="" earliest="-1d@d" latest="0d@d" | stats count by email | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternately, you could populate the summary index with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="blah" | sistats dc(email)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Aug 2010 23:12:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-Count-on-Summary-Index/m-p/39674#M9078</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-30T23:12:31Z</dc:date>
    </item>
  </channel>
</rss>

