Splunk Search

Search to count the number of failed logins since last successful login

jds2726
Loves-to-Learn

Hey everyone, I'm trying to write a search that will show the login events that occurred after the last successful logon event. So far I have this:

index="[index name]" sourcetype=WinEventLog "eventcode=4625" earliest=lastLogon | eval lastLogon=

where lastLogin = the time value of the last event from this search:

index="[index name]" sourcetype=WinEventLog "eventcode=4624"

Failed Logons: index="[index name]" sourcetype=WinEventLog "EventCode=4625"

Successful Logons: index="[index name]" sourcetype=WinEventLog "EventCode=4624"

Does anyone have an idea of how to evaluate this?

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jds2726,

you could use the transaction command bu it isn't very efficient (e.g. number of logfail >10):

index="[index name]" sourcetype=WinEventLog (EventCode=4624 OR EventCode=4625)
| trasnsaction Account_name host endswith="EventCode=4625"
| where eventcount>10 

 Ciao.

Giuseppe

0 Karma

jds2726
Loves-to-Learn

This only seems to get me successful logon attempts that end with a failure, rater than a list of all logon failures that came after the most recent successful logon

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jds2726,

sorry!

yes the other EventCode:

index="[index name]" sourcetype=WinEventLog (EventCode=4624 OR EventCode=4625)
| trasnsaction Account_name host endswith="EventCode=4624"
| where eventcount>10 

Ciao.

Giuseppe 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...