Splunk Enterprise Security

Correlating multiple logs to get combined data for Active Directory Events

cchintha
New Member

All, Need help with combining logs from Load Balancer/SNAT and AD Domain Controller to get the combined results in a single query. I could come up with separate queries and looking for help combining them

Query 1: AD Domain Controller logs that gives the logged in user details and LB ip and outbound port

source = WinEventLog:Security  AND EventCode=4624 AND  Account_Domain=XYZINC AND Source_Network_Address != null AND Source_Network_Address!="-" | rex field=_raw "Source Port:<(?<src_port>.*)>" | eval num = mvcount(Account_Name) | eval account= if( num=2, mvindex(Account_Name, 1), mvindex(Account_Name, 0) ) | search (NOT account="*\$*") | stats list(account) as al  count by _time,src_ip,src_port | table _time  count al src_ip  src_port

Sample Data

_time count al src_ip src_port
2019-11-10 14:54:36 1 xyzlogin 10.173.22.117 62623

Query 2: Load Balancer logs contain the real client ip and LB ip and outbound port

sourcetype="cisco_syslog" source="/opt/syslog-ng/log/loadbal*.log" \<-\> | rex field=_raw "^(?P<Time>\w+\s+\d+\s+\d+:\d+:\d+)[^:\n]*:(?P<Client_IP>[^%]+)%\d+:(?P<NAT_PORT>\d+)(?:[^ \n]* ){4}(?P<NAT_IP>[^%]+)" | table _time Client_IP NAT_IP NAT_PORT

_time Client_IP NAT_IP NAT_PORT
2019-11-10 14:54:25 10.173.128.78 10.173.22.117 62623

Assuming Query1 result as A and Query to result as B

matching criteria for both the queries is

A.src_ip = B.NAT_IP AND A.src_port = B.NAT_PORT AND A._time ~ B._time +20s (check for the events in the range of 20 secs for match, because request hits LB first and then goes to AD Domain controller)

Now I'm looking for combining these two in an effective way to get output in the format

_time count al client_ip
2019-11-10 14:54:36 1 xyzlogin 10.173.128.78

Any help will be appreciated. Thanks

0 Karma

lkutch_splunk
Splunk Employee
Splunk Employee

Which version of ES are you using? Maybe you could do it with a sequence template?
https://docs.splunk.com/Documentation/ES/6.0.0/Admin/Sequencecorrelationsearches

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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...