<?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: Simple newbie question - &amp;quot;stats count per user&amp;quot; not alerting in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33997#M7261</link>
    <description>&lt;P&gt;Ayn&lt;/P&gt;

&lt;P&gt;I had already removed the index and sourcetype and tried again.&lt;BR /&gt;
As per my last post :&lt;/P&gt;

&lt;P&gt;"I noticed that when I remove the "index=foo sourcetype=goo" part and test again the 3 events show up in the timeline. They still don't show in the results field or get emailed though."&lt;/P&gt;

&lt;P&gt;Search : "Failed password" | stats count by user&lt;BR /&gt;
Start time : rt-1m&lt;BR /&gt;
End time : rt-0m&lt;BR /&gt;
Condition : If condition is met Custom condition&lt;BR /&gt;
search : search count &amp;gt; 2&lt;BR /&gt;
Alert mode : once per search&lt;/P&gt;

&lt;P&gt;This does show all 3 events in the linear scale but in the area where you usually see the actual raw message it still says "No results found". I"m pretty sure this is why no email is triggered since it would have no raw message to send right ?&lt;BR /&gt;
It looks like piping to the stats count removes the actual raw message and converts it to just a counter.&lt;BR /&gt;
Are you saying I should get an alert whenever I see an event show up in the linear scale ?&lt;/P&gt;</description>
    <pubDate>Tue, 14 Aug 2012 22:59:22 GMT</pubDate>
    <dc:creator>stucky101</dc:creator>
    <dc:date>2012-08-14T22:59:22Z</dc:date>
    <item>
      <title>Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33991#M7255</link>
      <description>&lt;P&gt;Gurus&lt;BR /&gt;
I just started playing with splunk and after reading the alert howto it looks like a real-time/rolling window alert is a good start.&lt;BR /&gt;
I tested a simple "Failed password" scenario where more than 2 failed logins per 60 seconds should trigger an alert.&lt;BR /&gt;
This works as expected for all usernames. If I have the same user fail to logon 3 times within 60 seconds it sends an email.&lt;BR /&gt;
However, it also sends an email when 3 different users fail to log on within this timeframe. I'm pretty sure "stats count per user" is the answer here but when I add that to "Failed password" in my search nothing triggers anymore. Not even when the same user fails 3 times within 60 seconds.&lt;BR /&gt;
I believe there is a stats table that gets created as described here :&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/User/Alertusecases"&gt;http://docs.splunk.com/Documentation/Splunk/latest/User/Alertusecases&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This article makes it sound like I can just add this pipe to my query to make the alert aware of whether the same user fails or various users. Clearly I'm missing something.&lt;BR /&gt;
I might have some misconception here but shouldn't I be able to view this table in the alert dashboard ? Where can I see the results in this table ?&lt;BR /&gt;
The alert is "Failed password | stats count per user". As soon as I remove the pipe it starts working as before.&lt;/P&gt;

&lt;P&gt;Any hint is appreciated.&lt;/P&gt;

&lt;P&gt;Thx&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 02:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33991#M7255</guid>
      <dc:creator>stucky101</dc:creator>
      <dc:date>2012-08-14T02:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33992#M7256</link>
      <description>&lt;P&gt;I realized the example also pipes this to an actual table which I hadn't done so I tried this :&lt;/P&gt;

&lt;P&gt;Failed password | stats count by user | table user&lt;/P&gt;

&lt;P&gt;but still no alerts. Do I need to read the table manually ? Sorry if this is a stupid question...&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 02:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33992#M7256</guid>
      <dc:creator>stucky101</dc:creator>
      <dc:date>2012-08-14T02:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33993#M7257</link>
      <description>&lt;P&gt;Create a scheduled search like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=goo "Failed Password" | stats count by user 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Select Condition -&amp;gt; "if custom condition is met".&lt;/P&gt;

&lt;P&gt;And enter this as the Custom condition search :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search count &amp;gt; 2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Aug 2012 06:16:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33993#M7257</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2012-08-14T06:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33994#M7258</link>
      <description>&lt;P&gt;Damien&lt;/P&gt;

&lt;P&gt;Thanks for your reply. I have the following now :&lt;/P&gt;

&lt;P&gt;Search : index=foo sourcetype=goo "Failed password" | stats count by user&lt;BR /&gt;
Start time : rt-1m&lt;BR /&gt;
End time : rt-0m&lt;BR /&gt;
Condition : If condition is met&lt;BR /&gt;
Custom condition search : search count &amp;gt; 2&lt;BR /&gt;
Alert mode : once per search&lt;/P&gt;

&lt;P&gt;When I try to log on to a system 3 times in 60 seconds and fail the dashboard doesn't show any events now and nothing gets emailed.&lt;BR /&gt;
I noticed that when I remove the "index=foo sourcetype=goo" part and test again the 3 events show up in the timeline. They still don't show in the results field or get emailed though.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 19:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33994#M7258</guid>
      <dc:creator>stucky101</dc:creator>
      <dc:date>2012-08-14T19:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33995#M7259</link>
      <description>&lt;P&gt;The &lt;CODE&gt;index=foo sourcetype=goo&lt;/CODE&gt; were just examples of what you could put in your search. As in, "let's say you have logs with sourcetype 'foo' in your index 'goo'.". You have to modify the search terms to fit your situation. If putting just "failed password" worked just fine for you, just modify the search to just use that as a search term again.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 20:11:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33995#M7259</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-14T20:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33996#M7260</link>
      <description>&lt;P&gt;That's right, thanks Ayn &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 21:18:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33996#M7260</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2012-08-14T21:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33997#M7261</link>
      <description>&lt;P&gt;Ayn&lt;/P&gt;

&lt;P&gt;I had already removed the index and sourcetype and tried again.&lt;BR /&gt;
As per my last post :&lt;/P&gt;

&lt;P&gt;"I noticed that when I remove the "index=foo sourcetype=goo" part and test again the 3 events show up in the timeline. They still don't show in the results field or get emailed though."&lt;/P&gt;

&lt;P&gt;Search : "Failed password" | stats count by user&lt;BR /&gt;
Start time : rt-1m&lt;BR /&gt;
End time : rt-0m&lt;BR /&gt;
Condition : If condition is met Custom condition&lt;BR /&gt;
search : search count &amp;gt; 2&lt;BR /&gt;
Alert mode : once per search&lt;/P&gt;

&lt;P&gt;This does show all 3 events in the linear scale but in the area where you usually see the actual raw message it still says "No results found". I"m pretty sure this is why no email is triggered since it would have no raw message to send right ?&lt;BR /&gt;
It looks like piping to the stats count removes the actual raw message and converts it to just a counter.&lt;BR /&gt;
Are you saying I should get an alert whenever I see an event show up in the linear scale ?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 22:59:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33997#M7261</guid>
      <dc:creator>stucky101</dc:creator>
      <dc:date>2012-08-14T22:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33998#M7262</link>
      <description>&lt;P&gt;Is the "user" field being extracted properly ? Also check the fieldname case, field names are case sensitive(user, User, USER)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 23:16:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33998#M7262</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2012-08-14T23:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Simple newbie question - "stats count per user" not alerting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33999#M7263</link>
      <description>&lt;P&gt;Ok it has to do with the hostname field. Let's start with a basic search&lt;/P&gt;

&lt;P&gt;"Failed password"&lt;/P&gt;

&lt;P&gt;this gets 367 results such as&lt;/P&gt;

&lt;P&gt;Aug 14 16:53:17 hostname sshd[31840]: Failed password for invalid user test_tuesday from {srcip} port 56847 ssh2&lt;/P&gt;

&lt;P&gt;When I try to get a stats counter for the user by changing this to&lt;/P&gt;

&lt;P&gt;"Failed password" | stats count by user&lt;/P&gt;

&lt;P&gt;for the same timeframe I get the following table&lt;/P&gt;

&lt;P&gt;user1 count 8&lt;BR /&gt;
user2 count 1&lt;/P&gt;

&lt;P&gt;That's it. When I drill down on the first user I get the message and it looks almost like the other one but it's from a few weeks ago.&lt;/P&gt;

&lt;P&gt;Jul 24 17:31:11 hostname.domain.com sshd[1329]: Failed password for invalid user user1 from 10.91.25.76 port 54427 ssh2&lt;/P&gt;

&lt;P&gt;Then I noticed is that this older message has the fqdn in it as a hostname and the newer ones don't.&lt;BR /&gt;
I went through a short period where I was sending fqdns in the syslogs but changed that back soon after. Now it appears only messages that have the fqdn in there are extracting the user field. This would explain why the 1 minute or even 7 days timeframe doesn't yield any results.&lt;BR /&gt;
I double checked and the same thing is true for the other user.&lt;/P&gt;

&lt;P&gt;Isn't the hostname usually short in standard syslog ?  Unless a '.' is used as delimiter I don't see how that would affect the extraction of the user field.&lt;/P&gt;

&lt;P&gt;Am I onto something ?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2012 00:15:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-newbie-question-quot-stats-count-per-user-quot-not/m-p/33999#M7263</guid>
      <dc:creator>stucky101</dc:creator>
      <dc:date>2012-08-15T00:15:27Z</dc:date>
    </item>
  </channel>
</rss>

