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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...