Monitoring Splunk

Monitoring for login failures - Events are on different lines

cj039165
New Member

I need to monitor for the following condition. The "PsftpManager.GetPsftpCommand Cmd:" string will get me the user ID that failed. The "PsftpManager.Execute SFTP returnCode: 1" tells me that the login failed. How do I link these two together. They are separated by 21 seconds in the logs. The "PsftpManager.GetPsftpCommand Cmd:" comes out in the logs for every successful and failed login attempt. I need to make sure I'm not showing a login ID for an event that worked and linking it to the return code:1. Hope I'm not being confusing.

Log Example:
07/03/2016 08:05:00 DEBUG PsftpManager.GetPsftpCommand Started
07/03/2016 08:05:00 DEBUG PsftpManager.GetPsftpCommand Cmd: c:\adminscripts\psftp.exe -P 9999 -l PRJB0Y2@9999999 -pw Hdx$9999 -b f:\sftproot\custdm10.hdx-609\prod\0\reports\inbound\himk\rad979F1.tmp -bc -v -batch 10.174.13.58 > f:\sftproot\custdm10.hdx-609\prod\0\reports\inbound\himk\radAAAE0.tmp
07/03/2016 08:05:21 ERROR PsftpManager.Execute SFTP returnCode: 1

Thanks

Tags (1)
0 Karma

sundareshr
Legend

Try this

...  | rex "(?<prg>PsftpManager)" | transaction startswith="PsftpManager.GetPsftpCommand Cmd" endswith="PsftpManager.Execute SFTP returnCode: 1" maxspan=30s | table prg duration eventcount
0 Karma

cj039165
New Member

This work well with only one exception. I'm seeing results with multiple sources in it. For example:

source = F:\SFTPROOT\custdm10.HDX-609\Fidelis.log source = F:\SFTPROOT\custdm10.HDX-609\Highmark.log

How do I get the results broken out so it's per source log?

Thanks!

0 Karma

somesoni2
Revered Legend
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...