Splunk Search

How to use the _time field from the results of one search to run another search on another host and sourcetype?

neiowe
Path Finder

I am looking to take the results of the following search:

sourcetype="cisco:asa" AND dest_ip=10.3.10.12 AND dest_port=22 | table _time, src_ip, src_port, dest_ip, dest_port 

and use the _time field from the results and then search the following host/sourcetype:

sourcetype="WinEventLog:Security" host=dc001-sd502v

for all events within +/_ 2.5 secs of the _time from the first search. Would I use a subsearch to accomplish this? If so, can someone guide me on what the outer search would look like? Is there a better way to accomplish this?

Tags (3)
0 Karma
1 Solution

cmerriman
Super Champion

try something like :

sourcetype="cisco:asa" AND dest_ip=10.3.10.12 AND dest_port=22 | table _time, src_ip, src_port, dest_ip, dest_port 
|bucket _time span=5s
|join _time [search sourcetype="WinEventLog:Security" host=dc001-sd502v|bucket _time span=5s]

might get you what you need, or close to it.

View solution in original post

cmerriman
Super Champion

try something like :

sourcetype="cisco:asa" AND dest_ip=10.3.10.12 AND dest_port=22 | table _time, src_ip, src_port, dest_ip, dest_port 
|bucket _time span=5s
|join _time [search sourcetype="WinEventLog:Security" host=dc001-sd502v|bucket _time span=5s]

might get you what you need, or close to it.

neiowe
Path Finder

Thanks. That works great too. The only change I had to make was to add search inside the open bracket. I like this command since the output includes both the fields from the initial search.

0 Karma

cmerriman
Super Champion

oops, sorry about forgetting 'search'! glad it worked!

0 Karma

somesoni2
Revered Legend
0 Karma

neiowe
Path Finder

Thanks. The Map command does the trick.

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

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