<?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 of multiple values from the same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244951#M72972</link>
    <description>&lt;P&gt;Thanks for your response! Actually it's not working. It's simply showing a empty space.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2016 15:40:49 GMT</pubDate>
    <dc:creator>kamaleshwar</dc:creator>
    <dc:date>2016-03-10T15:40:49Z</dc:date>
    <item>
      <title>Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244942#M72963</link>
      <description>&lt;P&gt;I have some fields "Codes" "Count". In the "Codes" field i'll get multiple values and will count the values totally by using "dc(Codes) as Count". But i need the unique count of each code.&lt;/P&gt;

&lt;P&gt;For Ex.   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Codes        Count
123             10
111
222
333
444
555
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above is showing us as total count of values, but i need the unique count of each values like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Codes        Count
    123             5
    111             1
    222             1
    333             1
    444             1
    555             1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please help on this. If you have any questions please post. Thanks in advance!!!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 12:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244942#M72963</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2016-03-10T12:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244943#M72964</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Simply do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch
| stats count by Codes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it'll give you the output you are looking for.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 12:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244943#M72964</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-03-10T12:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244944#M72965</link>
      <description>&lt;P&gt;Sounds like adding a by clause will give you what you need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by code 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Mar 2016 12:59:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244944#M72965</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2016-03-10T12:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244945#M72966</link>
      <description>&lt;P&gt;hi, &lt;BR /&gt;
with this query, you have the answer&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search |stats dc(Codes) as Count_Codes by field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where &lt;CODE&gt;field&lt;/CODE&gt; contains the values of the field codes&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:05:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244945#M72966</guid>
      <dc:creator>gyslainlatsa</dc:creator>
      <dc:date>2016-03-10T13:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244946#M72967</link>
      <description>&lt;P&gt;Actually the result should be like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID                        Codes        Count
example1            123            5
                              111            1
                              222            1
                              333            1
                              444            1
                              555            1

Example2            668            3
                              554            1
                              666            1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244946#M72967</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2016-03-10T13:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244947#M72968</link>
      <description>&lt;P&gt;this one won't help if we have multiple user using multiple codes. I've added the sample result above.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:12:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244947#M72968</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2016-03-10T13:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244948#M72969</link>
      <description>&lt;P&gt;If there's an ID simply do it this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; yoursearch
| stats count by Codes, ID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to display it exactly the way you mentioned above then this is probably closer:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch
| stats count by Codes, ID
| stats list(Codes) as Codes, list(count) as count by ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:29:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244948#M72969</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-03-10T13:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244949#M72970</link>
      <description>&lt;P&gt;See my second answer below.&lt;BR /&gt;
Please let me know if that's not exactly what you are looking for.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244949#M72970</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-03-10T13:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244950#M72971</link>
      <description>&lt;P&gt;Ah ok, then try this one:&lt;/P&gt;

&lt;P&gt;...  | stats count by ID code | stats list(code) AS code list(count) AS count by ID&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244950#M72971</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2016-03-10T13:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244951#M72972</link>
      <description>&lt;P&gt;Thanks for your response! Actually it's not working. It's simply showing a empty space.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 15:40:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244951#M72972</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2016-03-10T15:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244952#M72973</link>
      <description>&lt;P&gt;Thanks for your response! Actually it's not working. It's simply showing a empty space.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 15:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244952#M72973</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2016-03-10T15:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of multiple values from the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244953#M72974</link>
      <description>&lt;P&gt;Thanks for your response! This is not exactly i want.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 15:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-multiple-values-from-the-same-field/m-p/244953#M72974</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2016-03-10T15:41:23Z</dc:date>
    </item>
  </channel>
</rss>

