<?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 showcase the count of devices and userlogged in? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655561#M226458</link>
    <description>&lt;P&gt;So it appears you want 2 counts? number of users per host and number of hosts per user.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your search of:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=M365 type=logged in&lt;BR /&gt;| stats count(username) as usernamecount by username,hostname&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Gives just a count of the number of time the field username show up for events with a unique username and hostname combination.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you want unique number of users per hostname..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| stats dc(username) AS unique_users, count(username) AS total_logins by hostname&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Unique number of hosts per user..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| stats dc(hostname) AS unique_hosts, count(hostname) AS total_logins by username&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Combining them is a little more difficult. You could try:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=M365 type=logged in&amp;nbsp;&lt;BR /&gt;| eventstats dc(hostname)&amp;nbsp; AS host_count by username&lt;BR /&gt;&lt;/SPAN&gt;|&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;stats count(username) as usernamecount,max(host_count) AS host_count by username,hostname&lt;/SPAN&gt;&lt;BR /&gt;| table username,hostname,unique_host_ct,unique_user_count&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2023 00:31:10 GMT</pubDate>
    <dc:creator>aromanauskas</dc:creator>
    <dc:date>2023-08-25T00:31:10Z</dc:date>
    <item>
      <title>How to showcase the count of devices and userlogged in?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655398#M226396</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;We have users logging in multiple devices. So, we need to showcase the count of devices&amp;nbsp; and user logged in. Can you please advise the query for same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nagalakshmi A&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 19:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655398#M226396</guid>
      <dc:creator>Nagalakshmi</dc:creator>
      <dc:date>2023-08-23T19:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to showcase the count of devices and userlogged in?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655423#M226405</link>
      <description>&lt;P&gt;Please give an example of your data&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 00:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655423#M226405</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-08-24T00:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to showcase the count of devices and userlogged in?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655532#M226446</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;for example index=M365 type=logged in | stats count(username) as usernamecount by username,hostname. by this query we are getting expected results such as username,hostname.&lt;/P&gt;&lt;P&gt;however we need a field where system count can be shown for the userloggedIn.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;By trying below command, we are getting the number of times users logged in to the systems, but we require system count a user logged in&lt;BR /&gt;&lt;BR /&gt;index=M365 type=logged in | stats count(username) as usernamecount by username,hostname&lt;BR /&gt;| where usernamecount&amp;gt;1&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 18:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655532#M226446</guid>
      <dc:creator>Nagalakshmi</dc:creator>
      <dc:date>2023-08-24T18:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to showcase the count of devices and userlogged in?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655536#M226447</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example index=M365 type=logged in | stats count(username) as usernamecount by username,hostname. by this query we are getting expected results such as username,hostname.&lt;/P&gt;&lt;P&gt;however we need a field where system count can be shown for the userloggedIn.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;By trying below command, we are getting the number of times users logged in to the systems, but we require system count a user logged in&lt;BR /&gt;&lt;BR /&gt;index=M365 type=logged in | stats count(username) as usernamecount by username,hostname&lt;BR /&gt;| where usernamecount&amp;gt;1&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 18:47:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655536#M226447</guid>
      <dc:creator>Nagalakshmi</dc:creator>
      <dc:date>2023-08-24T18:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to showcase the count of devices and userlogged in?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655561#M226458</link>
      <description>&lt;P&gt;So it appears you want 2 counts? number of users per host and number of hosts per user.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your search of:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=M365 type=logged in&lt;BR /&gt;| stats count(username) as usernamecount by username,hostname&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Gives just a count of the number of time the field username show up for events with a unique username and hostname combination.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you want unique number of users per hostname..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| stats dc(username) AS unique_users, count(username) AS total_logins by hostname&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Unique number of hosts per user..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| stats dc(hostname) AS unique_hosts, count(hostname) AS total_logins by username&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Combining them is a little more difficult. You could try:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=M365 type=logged in&amp;nbsp;&lt;BR /&gt;| eventstats dc(hostname)&amp;nbsp; AS host_count by username&lt;BR /&gt;&lt;/SPAN&gt;|&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;stats count(username) as usernamecount,max(host_count) AS host_count by username,hostname&lt;/SPAN&gt;&lt;BR /&gt;| table username,hostname,unique_host_ct,unique_user_count&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 00:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655561#M226458</guid>
      <dc:creator>aromanauskas</dc:creator>
      <dc:date>2023-08-25T00:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to showcase the count of devices and userlogged in?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655562#M226459</link>
      <description>&lt;P&gt;Minor issue with the search is that the &lt;STRONG&gt;type=logged in&lt;/STRONG&gt;&amp;nbsp;is going to look for a field 'type' with a value of &lt;STRONG&gt;logged&lt;/STRONG&gt;, and then the word&amp;nbsp;&lt;STRONG&gt;in&lt;/STRONG&gt; somewhere in the event. Maybe you mean&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=M365 type="logged in" &lt;/LI-CODE&gt;&lt;P&gt;As for showing the count - do you mean you want to show the number of&amp;nbsp;&lt;STRONG&gt;different&lt;/STRONG&gt; users who have logged into the same hostname?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=M365 type="logged in"
| stats count as usernamecount by username, hostname
| eventstats dc(username) as UniqueUsers by hostname&lt;/LI-CODE&gt;&lt;P&gt;You don't need '&lt;STRONG&gt;count(username)&lt;/STRONG&gt;' which is counting the events that contain the username field for each user, but you are splitting by username, so its redundant. Just use "count"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 00:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655562#M226459</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-08-25T00:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to showcase the count of devices and userlogged in?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655809#M226506</link>
      <description>&lt;P&gt;Thanks for your suggestions!!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 10:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-showcase-the-count-of-devices-and-userlogged-in/m-p/655809#M226506</guid>
      <dc:creator>Nagalakshmi</dc:creator>
      <dc:date>2023-08-28T10:39:22Z</dc:date>
    </item>
  </channel>
</rss>

