<?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: Why does count and dc behave differently? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-count-and-dc-behave-differently/m-p/470612#M132384</link>
    <description>&lt;P&gt;&lt;CODE&gt;dc&lt;/CODE&gt; is Distinct Count.  It says how many unique values of the given field(s) exist.  Since you did not supply a field name, it counted all fields and grouped them by the status field values.&lt;/P&gt;

&lt;P&gt;Had you used &lt;CODE&gt;dc(status)&lt;/CODE&gt; the result should have been &lt;CODE&gt;7&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;count&lt;/CODE&gt; and &lt;CODE&gt;dc&lt;/CODE&gt; generally are not interchangeable.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Dec 2019 19:51:51 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-12-30T19:51:51Z</dc:date>
    <item>
      <title>Why does count and dc behave differently?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-count-and-dc-behave-differently/m-p/470611#M132383</link>
      <description>&lt;P&gt;I have written the query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" host="web_application" 
| stats count by status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result is: &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;status    count&lt;BR /&gt;
200 233056&lt;BR /&gt;
400 4156&lt;BR /&gt;
403 1658&lt;BR /&gt;
404 3652&lt;BR /&gt;
406 4184&lt;BR /&gt;
408 4142&lt;BR /&gt;
500 4088&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I am happy with this. But when I use dc for the same, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" host="web_application" 
| stats dc by status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;status    dc(JSESSIONID)  dc(action)  dc(bytes)   dc(categoryId)  dc(clientip)    dc(date_hour)   dc(date_mday)   dc(date_minute) dc(date_month)  dc(date_second) dc(date_wday)   dc(date_year)   dc(date_zone)   dc(detail)  dc(file)    dc(host)    dc(ident)   dc(index)   dc(items)   dc(linecount)   dc(method)  dc(msg) dc(other)   dc(password)    dc(pg)  dc(productId)   dc(punct)   dc(q)   dc(referer) dc(referer_domain)  dc(req_time)    dc(root)    dc(source)  dc(sourcetype)  dc(splunk_server)   dc(start)   dc(t)   dc(timeendpos)  dc(timestartpos)    dc(uri) dc(uri_path)    dc(uri_query)   dc(user)    dc(useragent)   dc(version)&lt;BR /&gt;
200 11192   5   3802    7   183 24  30  60  2   60  7   1   1   1   10  1   1   1   0   1   2   5   902 1   9   16  105 1   110 5   106359  2   1   1   1   1   0   7   7   95883   12  95879   1   26  1&lt;BR /&gt;
400 1837    5   1595    1   182 24  30  60  2   60  7   1   1   0   5   1   1   1   0   1   2   0   794 0   0   2   80  0   13  4   2078    0   1   1   1   0   0   7   7   2021    5   2021    1   26  1&lt;BR /&gt;
403 670 5   657 1   178 24  30  60  2   60  7   1   1   2   6   1   1   1   0   1   2   0   536 0   0   1   70  0   15  4   826 1   1   1   1   0   0   7   7   713 6   712 1   26  1&lt;BR /&gt;
404 1624    5   1471    1   183 24  30  60  2   60  7   1   1   0   21  1   1   1   1   1   2   0   793 0   0   2   87  0   16  4   1826    7   1   1   1   0   1   7   7   1803    26  1743    1   26  1&lt;BR /&gt;
406 1850    5   1635    1   182 24  30  60  2   60  7   1   1   0   5   1&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Why is this? What is that I am missing? &lt;BR /&gt;
It may be a dumb question but. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:27:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-count-and-dc-behave-differently/m-p/470611#M132383</guid>
      <dc:creator>palisetty</dc:creator>
      <dc:date>2020-09-30T03:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why does count and dc behave differently?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-count-and-dc-behave-differently/m-p/470612#M132384</link>
      <description>&lt;P&gt;&lt;CODE&gt;dc&lt;/CODE&gt; is Distinct Count.  It says how many unique values of the given field(s) exist.  Since you did not supply a field name, it counted all fields and grouped them by the status field values.&lt;/P&gt;

&lt;P&gt;Had you used &lt;CODE&gt;dc(status)&lt;/CODE&gt; the result should have been &lt;CODE&gt;7&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;count&lt;/CODE&gt; and &lt;CODE&gt;dc&lt;/CODE&gt; generally are not interchangeable.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 19:51:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-count-and-dc-behave-differently/m-p/470612#M132384</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-12-30T19:51:51Z</dc:date>
    </item>
  </channel>
</rss>

