<?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: How to get field count rather than stats count? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450622#M171353</link>
    <description>&lt;P&gt;Yeah what you said "index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats dc(devtype) &lt;BR /&gt;
but this only gives the unique values &amp;amp; count of devtype field" is exactly right. So I was asking the question sort of wrong. &lt;/P&gt;

&lt;P&gt;ultimately my query ended up looking like this to give me my desired output:&lt;BR /&gt;
 index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats dc(src_mac) by devtype&lt;/P&gt;

&lt;P&gt;which give me a count of src_mac and groups them by devtype&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:29:17 GMT</pubDate>
    <dc:creator>summitsplunk</dc:creator>
    <dc:date>2020-09-30T00:29:17Z</dc:date>
    <item>
      <title>How to get field count rather than stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450618#M171349</link>
      <description>&lt;P&gt;Here's my query:&lt;/P&gt;

&lt;P&gt;index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats count by devtype&lt;/P&gt;

&lt;P&gt;What I want to do is get something like this :&lt;/P&gt;

&lt;P&gt;devtype&lt;/P&gt;

&lt;P&gt;iphone  100&lt;BR /&gt;
windows 105&lt;BR /&gt;
Android 200&lt;/P&gt;

&lt;P&gt;I don't want stats on all of the events. I just want the totals of of all the possibilities for the devtype Field. How would I write this?&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 20:36:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450618#M171349</guid>
      <dc:creator>summitsplunk</dc:creator>
      <dc:date>2019-05-09T20:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get field count rather than stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450619#M171350</link>
      <description>&lt;P&gt;@summitsplunk Can you be more clear, looking at the desired output you have shared your query looks correct , do you have some sample data with output example?&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 21:23:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450619#M171350</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-05-09T21:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get field count rather than stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450620#M171351</link>
      <description>&lt;P&gt;Figured it out. So I just didn't know how to ask the question but with some googling I found the write term which is "Distinct Count"... Basically I wanted to get a distinct count of each field. Like seen in this article:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/46241/how-can-i-retrieve-count-or-distinct-count-of-some-field-values-using-stats-function.html"&gt;https://answers.splunk.com/answers/46241/how-can-i-retrieve-count-or-distinct-count-of-some-field-values-using-stats-function.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 21:28:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450620#M171351</guid>
      <dc:creator>summitsplunk</dc:creator>
      <dc:date>2019-05-09T21:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get field count rather than stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450621#M171352</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Are you looking for this&lt;/P&gt;

&lt;P&gt;index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats count(devtype) as count&lt;/P&gt;

&lt;P&gt;&amp;amp; if you are looking for distinct count  - index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats dc(devtype) &lt;BR /&gt;
but this only gives the unique values &amp;amp; count of devtype field which is not you are looking for i guess.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 23:05:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450621#M171352</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2019-05-09T23:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get field count rather than stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450622#M171353</link>
      <description>&lt;P&gt;Yeah what you said "index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats dc(devtype) &lt;BR /&gt;
but this only gives the unique values &amp;amp; count of devtype field" is exactly right. So I was asking the question sort of wrong. &lt;/P&gt;

&lt;P&gt;ultimately my query ended up looking like this to give me my desired output:&lt;BR /&gt;
 index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats dc(src_mac) by devtype&lt;/P&gt;

&lt;P&gt;which give me a count of src_mac and groups them by devtype&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:29:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450622#M171353</guid>
      <dc:creator>summitsplunk</dc:creator>
      <dc:date>2020-09-30T00:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get field count rather than stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450623#M171354</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="smt_fortigate" host="10.8.12.1" srcintf=mysummitwifi | stats dc(devtype)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 May 2019 05:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-field-count-rather-than-stats-count/m-p/450623#M171354</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-11T05:09:24Z</dc:date>
    </item>
  </channel>
</rss>

