Splunk Search

How to seperate succefully login attempt from invlaid Login id

jaibalaraman
Path Finder

Hi Team

Can anyone help me with Splunk search query to split the successful login from invalid? 

Ex - I want to exclude OK from the search, want to see only the locket out, invalid, invalid parameter

jaibalaraman_0-1712097718453.png

 

Thanks 

 

 

Labels (3)
Tags (1)
0 Karma

jaibalaraman
Path Finder

 

 

I tried,, but the search returning no result. 

 

jaibalaraman_1-1712100663756.png

 

 

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Whenever you use a field name in an 'eval' expression (where requires an eval expression), you need to use single quotes around the field name if the field name is on the right hand side of the eval statement and contains non-simple characters (in this case the full stop), so 

| where 'event.Properties.errMessage' != "OK"

Note the sometimes confusing use of single and double quotes used, for example this statement

| eval event.Properties.errMessage="Hello"

does NOT need quotes on the left hand side of the statement.

Where necessary, the left hand side use of quotes requires double quotes, so if your field name has a space, you would need

| eval "My Field With Spaces"="Hello"

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Or based on your other question, you can directly set that criteria in the initial search, i.e.

index=test event.Properties.errMessage!=OK
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| where event.Properties.errMessage != "OK"
0 Karma

jaibalaraman
Path Finder

Hi 

How do i seperate multiple error instead " OK "

Invalid password, reset password, permission denied etc

 

index=events event.Properties.errMessage != "Invalid LoginID","Account Temporarily Locked Out","Permission denied""Unauthorized user","Account Pending Verification","Invalid parameter value"
| stats count by event.Properties.errMessage

jaibalaraman_0-1712200150562.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=events event.Properties.errMessage!="Invalid LoginID" event.Properties.errMessage!="Account Temporarily Locked Out" event.Properties.errMessage!="Permission denied" event.Properties.errMessage!="Unauthorized user" event.Properties.errMessage!="Account Pending Verification" event.Properties.errMessage!="Invalid parameter value"
| stats count by event.Properties.errMessage
0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...