<?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: Detecting Multiple Logins where distinct count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481581#M193099</link>
    <description>&lt;P&gt;@willadams, are you looking for something similar to this ? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-")   User!=*$"
|timechart span=5m count(Source_Network_Address) by user
|addtotals row=true|where Total &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Nov 2019 13:12:23 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-11-11T13:12:23Z</dc:date>
    <item>
      <title>Detecting Multiple Logins where distinct count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481580#M193098</link>
      <description>&lt;P&gt;I am trying to figure out how to create a search where I am using multiple counts for an alert I am wanting to write.  The alert is effectively looking for a number of accounts failing authentication to a particular service.&lt;/P&gt;

&lt;P&gt;An example query may be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-") | bucket _time span=5m  | timechart count(Source_Network_Address) by Source_Network_Address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem with this search is that while it works, I am trying to expand on it further.  It shows my a total count irrespective of the number of times an account has tried.  My use case in this scenario is as follows:&lt;/P&gt;

&lt;P&gt;I want to be able to identify where the total number of users exceeds a threshold value but the account was only tried once over a short period of time.  So if I simply the scenario&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Service = myapp&lt;/LI&gt;
&lt;LI&gt;Period of time is 5mins&lt;/LI&gt;
&lt;LI&gt;Looking for a threshold of 30 (total count) where the count if for each user with a count of "1".&lt;/LI&gt;
&lt;LI&gt;Location (source) is 101.101.101.101&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So if looking at a log file as example&lt;/P&gt;

&lt;P&gt;07:30 - 07:35&lt;BR /&gt;
myapp account_login=User1&lt;BR /&gt;
myapp account_login=User2&lt;BR /&gt;
myapp account_login=User3&lt;BR /&gt;
myapp account_login=User4&lt;BR /&gt;
myapp account_login=User5&lt;BR /&gt;
myapp account_login=User6&lt;BR /&gt;
myapp account_login=User7&lt;BR /&gt;
myapp account_login=User8&lt;BR /&gt;
......&lt;/P&gt;

&lt;P&gt;So if the count of User1=1 AND User2=1 AND User3=1 AND User4=1........etc. and the total count was 30 (so 30 users) then tell me about it.&lt;/P&gt;

&lt;P&gt;I tried something along the lines of &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-")   User!=*$" | bucket _time span=5m  | timechart count(Source_Network_Address) by User  | where count &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-")   User!=*$" | bucket _time span=5m  | timechart dc(User) by Source_Network_Address | where count &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-")  User!=*$" | bucket _time span=5m  | stats dc(user) as TotalUser by user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-")  User!=*$" | bucket _time span=5m  | stats dc(user) as TotalUser by user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-")  User!=*$" | bucket _time span=5m  | stats count by user | timechart count(Source_Network_Address) by Source_Network_Address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But none of these work or I don't get any visualizations or tabulated data to show me the event.  &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:55:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481580#M193098</guid>
      <dc:creator>willadams</dc:creator>
      <dc:date>2020-09-30T02:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting Multiple Logins where distinct count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481581#M193099</link>
      <description>&lt;P&gt;@willadams, are you looking for something similar to this ? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-")   User!=*$"
|timechart span=5m count(Source_Network_Address) by user
|addtotals row=true|where Total &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 13:12:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481581#M193099</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-11-11T13:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting Multiple Logins where distinct count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481582#M193100</link>
      <description>&lt;P&gt;I altered my search so that it reads as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" Source_Network_Address IN("1.2.3.*","5.6.7.*")   User!=*$"  |timechart span=5m dc(user) by Source_Network_Adress | addtotals row=true | where Total &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My results end up with the following table&lt;/P&gt;

&lt;P&gt;_time| 1.2.3.98 | 1.2.3.46 | 5.6.7.10 | 5.6.7.241 | Total&lt;BR /&gt;
2019-11-12 10:30:00 | 1001 | 0 | 1 | 0 | 1002&lt;BR /&gt;
2019-11-12 10:35:00 | 569 | 0 | 1 | 1 | 571&lt;/P&gt;

&lt;P&gt;Is there a way that I can remove the values that are "0" or "1" as to only have the value 1.2.3.98 showing as this is the information I am interested in.&lt;/P&gt;

&lt;P&gt;I tried the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" Source_Network_Address IN("1.2.3.*","5.6.7.*")   User!=*$"  |timechart span=5m dc(user) by Source_Network_Adress | addtotals row=true | eventstats sum(Source_Network_Address) by Source_Network_Address | where Total &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" Source_Network_Address IN("1.2.3.*","5.6.7.*")   User!=*$"  |timechart span=5m dc(user) by Source_Network_Adress | stats count by Source_Network_Address as Total | where Total &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both queries return no results found.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 08:15:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481582#M193100</guid>
      <dc:creator>willadams</dc:creator>
      <dc:date>2019-11-12T08:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting Multiple Logins where distinct count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481583#M193101</link>
      <description>&lt;P&gt;If you want to find all Source_Network_Address instances that have more than 30 failed logons in 5min, but just one attempt per username, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows user="USER*" signature="User name is correct but the password is wrong" NOT Source_Network_Address IN("192.168.0.1","-") | bucket _time span=5m  | stats dc(user) as usercount count by _time,Source_Network_Address | where usercount=count AND count&amp;gt;30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This counts the number of attempts and the distinct number of user names attempted per source address (per 5min window). If those 2 counts are the same, that means each attempt was for a unique user.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:56:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481583#M193101</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-09-30T02:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting Multiple Logins where distinct count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481584#M193102</link>
      <description>&lt;P&gt;I suggest brushing up on your basics regarding the use of stats etc. You're doing impossible things. You can't sum ip addresses like &lt;CODE&gt;sum(Source_Network_Address)&lt;/CODE&gt;, you can't put &lt;CODE&gt;as Total&lt;/CODE&gt; at the end of a stats command after the by clause.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 10:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Detecting-Multiple-Logins-where-distinct-count/m-p/481584#M193102</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-11-12T10:43:22Z</dc:date>
    </item>
  </channel>
</rss>

