Splunk Search

searching for events in a source based on value of another source

kenbaugher
Path Finder

I have two sources that I'd like to combine/join or search on one based on the other.

Source 1 - has two fields  name & date

Source 2  - has several fields including name & date, field1, fields2, field3, etc.

 

I'd like to get the most recent date for a specific name from source 1, and show only the events in source 2 with that name & date

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You can use the first search as a subsearch to filter the second search - something like this

<search source2> [search <search source1> | stats latest(date) as date by name]
0 Karma

kenbaugher
Path Finder

Thank you, I had to play around with my search a bit, but this overall syntax was 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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...