<?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: Grouping by user, count by number of countries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-user-count-by-number-of-countries/m-p/287653#M87077</link>
    <description>&lt;P&gt;To get the number of countries a user has authenticated from you'll need to juggle your &lt;CODE&gt;stats&lt;/CODE&gt; around a bit:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats dc(County) by username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll give you the distinct count of country values for each user.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Oct 2015 23:22:28 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-10-23T23:22:28Z</dc:date>
    <item>
      <title>Grouping by user, count by number of countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-user-count-by-number-of-countries/m-p/287652#M87076</link>
      <description>&lt;P&gt;Using splunk to look at some auth data, and want to get search results that show the number of countries each user has logged in from.&lt;/P&gt;

&lt;P&gt;I've gotten as far as adding the iplocation information into the search results, and even getting the reverse of what i want (number of users who have logged into each country), but when i try to do something like a "&lt;EM&gt;stats count by Country&lt;/EM&gt;" it throws an error of: "&lt;EM&gt;Error in 'stats' command: The argument 'Country' is invalid.&lt;/EM&gt;"&lt;/P&gt;

&lt;P&gt;Any suggestions? Here's the basics of the search so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | iplocation clientLoginIp | stats count values(username) by Country | sort by count DESC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What am i missing?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 20:47:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-by-user-count-by-number-of-countries/m-p/287652#M87076</guid>
      <dc:creator>n_young</dc:creator>
      <dc:date>2015-10-23T20:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping by user, count by number of countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-user-count-by-number-of-countries/m-p/287653#M87077</link>
      <description>&lt;P&gt;To get the number of countries a user has authenticated from you'll need to juggle your &lt;CODE&gt;stats&lt;/CODE&gt; around a bit:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats dc(County) by username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll give you the distinct count of country values for each user.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 23:22:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-by-user-count-by-number-of-countries/m-p/287653#M87077</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-23T23:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping by user, count by number of countries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-user-count-by-number-of-countries/m-p/287654#M87078</link>
      <description>&lt;P&gt;That worked perfectly. Thanks. I figured i was just missing something for the Country parameter.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 17:11:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-by-user-count-by-number-of-countries/m-p/287654#M87078</guid>
      <dc:creator>n_young</dc:creator>
      <dc:date>2015-10-26T17:11:30Z</dc:date>
    </item>
  </channel>
</rss>

