<?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: Stats Distinct Count (X) + X[Values] in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342741#M161300</link>
    <description>&lt;P&gt;Based on your description and code, I have to assume that the field "subject" is holding the username...  &lt;/P&gt;</description>
    <pubDate>Fri, 21 Apr 2017 14:10:31 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-04-21T14:10:31Z</dc:date>
    <item>
      <title>Stats Distinct Count (X) + X[Values]</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342739#M161298</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;

&lt;P&gt;I have a query that gives me the following fields I want to work with. &lt;/P&gt;

&lt;P&gt;username &lt;BR /&gt;
Country (after using iplocation on src_ip)&lt;/P&gt;

&lt;P&gt;Some usernames have login from more than 2 countries.&lt;/P&gt;

&lt;P&gt;I want to see it on a chart that shows me the top 5 usernames based on how many countries they have log in and which countries are those.&lt;/P&gt;

&lt;P&gt;I believe I need to use dc(Country) at some point&lt;/P&gt;

&lt;P&gt;This is my search string&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main event=sso status=success ip!=10.0.0.0/8  | regex subject=^\D\d+$ | iplocation ip | stats dc(Country) by subject
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Apr 2017 06:08:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342739#M161298</guid>
      <dc:creator>JRamirezEnosys</dc:creator>
      <dc:date>2017-04-21T06:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Stats Distinct Count (X) + X[Values]</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342740#M161299</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main event=sso status=success ip!=10.0.0.0/8  | regex subject=^\D\d+$ | iplocation ip | stats dc(Country)  as Country_count values(Country) as Countries by subject | sort 5 - Country_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Apr 2017 12:37:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342740#M161299</guid>
      <dc:creator>andrey2007</dc:creator>
      <dc:date>2017-04-21T12:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Stats Distinct Count (X) + X[Values]</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342741#M161300</link>
      <description>&lt;P&gt;Based on your description and code, I have to assume that the field "subject" is holding the username...  &lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 14:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342741#M161300</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-04-21T14:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Stats Distinct Count (X) + X[Values]</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342742#M161301</link>
      <description>&lt;P&gt;If your end goal is to see the chart, try this version and select a stacked column/bar chart.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main event=sso status=success ip!=10.0.0.0/8  | regex subject=^\D\d+$ | iplocation ip | stats dc(Country)  as Country_count values(Country) as Countries by subject | sort 5 - Country_count
| mvexpand Countries | chart count over subject by Countries
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Apr 2017 15:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Distinct-Count-X-X-Values/m-p/342742#M161301</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-21T15:02:20Z</dc:date>
    </item>
  </channel>
</rss>

