<?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 (dc) threshold in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481036#M134795</link>
    <description>&lt;P&gt;&lt;CODE&gt;index = data | timechart span=1w dc(userid) as Users by version | where Users &amp;gt; 10&lt;/CODE&gt; should work.  Are you sure you have a field called 'userid' in the 'data' index?&lt;BR /&gt;
What do you get from &lt;CODE&gt;index = data | timechart span=1w dc(userid) as Users by version&lt;/CODE&gt;?&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 16:04:16 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-03-02T16:04:16Z</dc:date>
    <item>
      <title>distinct_count (dc) threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481035#M134794</link>
      <description>&lt;P&gt;I'm trying to eliminate results below a threshold with dc and it's not working. I only want to show versions that have at least 10 users. Here's some of what I've tried:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Syntax error&lt;BR /&gt;
index = data  | timechart span=1w dc(userid) as Users by version where Users &amp;gt; 10&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Only get 1 result back for a version "OTHER"&lt;BR /&gt;
index = data  | timechart span=1w dc(userid) as Users by version where dc &amp;gt; 10&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;No results&lt;BR /&gt;
index = data  | timechart span=1w dc(userid) as Users by version | where Users &amp;gt; 10&lt;BR /&gt;
index = data  | timechart span=1w dc(userid) as Users by version | where version &amp;gt; 10&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Nothing is filtered (count and dc are clearly different values)&lt;BR /&gt;
index = data  | timechart span=1w dc(userid) as Users by version where Users &amp;gt; 10 where count &amp;gt; 10&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 10:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481035#M134794</guid>
      <dc:creator>yannquique</dc:creator>
      <dc:date>2020-03-02T10:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: distinct_count (dc) threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481036#M134795</link>
      <description>&lt;P&gt;&lt;CODE&gt;index = data | timechart span=1w dc(userid) as Users by version | where Users &amp;gt; 10&lt;/CODE&gt; should work.  Are you sure you have a field called 'userid' in the 'data' index?&lt;BR /&gt;
What do you get from &lt;CODE&gt;index = data | timechart span=1w dc(userid) as Users by version&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 16:04:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481036#M134795</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-02T16:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: distinct_count (dc) threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481037#M134796</link>
      <description>&lt;P&gt;Thanks for the reply! Without the where clause, I get all the data I expect plus the values that don't interest me:&lt;BR /&gt;
_time:2020-03-03&lt;BR /&gt;
v3.1:210&lt;BR /&gt;
v3.2:1719&lt;BR /&gt;
v3.3.0:7&lt;/P&gt;

&lt;P&gt;When I add the where clause I get "No results found"&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 09:09:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481037#M134796</guid>
      <dc:creator>yannquique</dc:creator>
      <dc:date>2020-03-03T09:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: distinct_count (dc) threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481038#M134797</link>
      <description>&lt;P&gt;If it's important: I'm using Splunk Enterprise v7.3.3&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 09:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481038#M134797</guid>
      <dc:creator>yannquique</dc:creator>
      <dc:date>2020-03-03T09:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: distinct_count (dc) threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481039#M134798</link>
      <description>&lt;P&gt;@yannquique &lt;/P&gt;

&lt;P&gt;I believe When you do a &lt;STRONG&gt;timechart&lt;/STRONG&gt;, all you see there is your values split by versions for different time buckets and there is no field named Users for Splunk to apply that mathematical condition you specify in the &lt;STRONG&gt;where&lt;/STRONG&gt; clause and hence it is returning no results. &lt;/P&gt;

&lt;P&gt;Could you try this and see?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = data 
| bucket span=1w _time  
| stats dc(userid) as Users by _time version 
| where Users &amp;gt; 10 
| xyseries _time, version, Users 
| fillnull value=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Mar 2020 10:22:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481039#M134798</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2020-03-03T10:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: distinct_count (dc) threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481040#M134799</link>
      <description>&lt;P&gt;That works great! Thank you.&lt;BR /&gt;
I'm very impressed with your splunk query knowledge. I'm going to have to play around with all those commands to try and understand how it works. It's not simple and you got it first time.&lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 12:20:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/distinct-count-dc-threshold/m-p/481040#M134799</guid>
      <dc:creator>yannquique</dc:creator>
      <dc:date>2020-03-03T12:20:35Z</dc:date>
    </item>
  </channel>
</rss>

