Splunk Search

Tracking failed logins followed by successful logins using the transaction command

My
Engager

Hello,

I am trying to track failed logons followed by a successful one using the transaction command and the following criteria:

Limit the time span to 5 min,  add a startswith so each transaction will begin with a logon failure, add an endswith so each transaction will end with logon success and add a | where to find when the eventcount exceeds 3

this is what I have so farMy_0-1638152521000.png

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @My,

I don't like transaction command and I use it only when I haven't any other solution.

In your case, you could do this:

index=wineventlog sourcetype=xmlwineventlog:Security EventCode IN (4624,4625)
| stats dc(EventCode) AS dc_eventcode count(eval(EventCode=4625)) AS failed BY user host
| where dc_eventcode>1 AND failed>5

in this way you have the filter for more than 5 failed logins and a successful login grouped for user and host.

Ciao.

Giuseppe

0 Karma

rrovers
Contributor

I don't see what's wrong with this, except that I don't understand the "where eventcount >3". Without that I expect that it should give you the right results. Or what is it exactly that you are missing?

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!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

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 ...