<?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: Does distinct_count() in a timechart count unique instances per time slice or per chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108311#M28182</link>
    <description>&lt;P&gt;I downvoted this post because this shows unique per bucket, not per search period, which is what the requester was looking for.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 17:20:50 GMT</pubDate>
    <dc:creator>mschaaf</dc:creator>
    <dc:date>2017-11-14T17:20:50Z</dc:date>
    <item>
      <title>Does distinct_count() in a timechart count unique instances per time slice or per chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108307#M28178</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I was reading Example 3 in &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/Tutorial/Usethesearchlanguage"&gt;this&lt;/A&gt; tutorial - to do with distinct_count().&lt;/P&gt;

&lt;P&gt;I would like to know when you apply distinct_count() to a timechart, if it is counting something as distinct for a single time slice (i.e. counting it again in the next time slice) or if it is counting something as distinct across the entire chart.&lt;/P&gt;

&lt;P&gt;So, applied to Example 3, I think it would be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_* action=purchase category_id=flowers | timechart dc(clientip)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which I would expect to generate a timechart with the count of distinct/unique clientip over time. I.e. count a user when they first purchased flowers, and never count them again.&lt;/P&gt;

&lt;P&gt;Is this what is happening, or does it count the user once in the first month, and then count them once again in the second month (assuming time slices are in months)?&lt;/P&gt;

&lt;P&gt;The reason I am asking is that I want a time chart of the number of new users over time, so I do not want to count the same user ever again.&lt;/P&gt;

&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2012 23:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108307#M28178</guid>
      <dc:creator>nosignal</dc:creator>
      <dc:date>2012-10-30T23:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Does distinct_count() in a timechart count unique instances per time slice or per chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108308#M28179</link>
      <description>&lt;P&gt;No, it tells you the number of different people in each group-by clause (of which the time-slice is a part). If you want just the number of new users at any time, it's easier to just only count the first time you see a user:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats earliest(clientip) as clientip | timechart count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Oct 2012 23:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108308#M28179</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-10-30T23:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Does distinct_count() in a timechart count unique instances per time slice or per chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108309#M28180</link>
      <description>&lt;P&gt;I think &lt;CODE&gt;... | timechart dc(clientIP) as clientIP&lt;/CODE&gt; is a better option.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 06:51:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108309#M28180</guid>
      <dc:creator>varunbiswas</dc:creator>
      <dc:date>2016-12-17T06:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Does distinct_count() in a timechart count unique instances per time slice or per chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108310#M28181</link>
      <description>&lt;P&gt;this one works! thank you!!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 01:55:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108310#M28181</guid>
      <dc:creator>kimikoyan</dc:creator>
      <dc:date>2017-06-30T01:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Does distinct_count() in a timechart count unique instances per time slice or per chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108311#M28182</link>
      <description>&lt;P&gt;I downvoted this post because this shows unique per bucket, not per search period, which is what the requester was looking for.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 17:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108311#M28182</guid>
      <dc:creator>mschaaf</dc:creator>
      <dc:date>2017-11-14T17:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Does distinct_count() in a timechart count unique instances per time slice or per chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108312#M28183</link>
      <description>&lt;P&gt;Since this thread seems to be still active and unsolved i'll post my solution: expanding the logic proposed by  @gkanapathy you can count the &lt;CODE&gt;_time&lt;/CODE&gt; of the first occurrence of a new IP address:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats earliest(_time) as _time by clientip | timechart count(_time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only problem with this  logic is that Ip addresses that have first appeared earlier than the time range considered will be counted in the first time span. It's a problem that's going to matter less the longer your time range and span are but, honestly, i don't know even if this can be solved and how.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 13:47:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108312#M28183</guid>
      <dc:creator>jlelli</dc:creator>
      <dc:date>2018-05-31T13:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Does distinct_count() in a timechart count unique instances per time slice or per chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108313#M28184</link>
      <description>&lt;P&gt;this works too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 09:51:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-distinct-count-in-a-timechart-count-unique-instances-per/m-p/108313#M28184</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2019-01-04T09:51:53Z</dc:date>
    </item>
  </channel>
</rss>

