Splunk Search

How to correlate logs with different sources to detect events

syh
Engager

Hi, what I am trying to do is to create a search query based on two sources.
Source 1 will be the logs I want to investigate in. Source 2 will be a list of malicious domains I want to compare Source 1 with. (Source 2 could also be a csv file I obtained online).
The result I want will be that I am able to detect malicious domains which maybe in source 1, based on data in source 2 (I hope I'm making sense).

I'm new to Splunk so any help will be greatly appreciated. Thank you.

0 Karma

woodcock
Esteemed Legend

Make/keep it a lookup like this:

index=YouShouldAlwaysSpecifyAnIndex ... | lookup YourThreatLookupFileHere.csv YourKeyFieldNameInLookup AS YourKeyFieldNameInEvents

This will pull in all the other fields from the CSV and attach them to the appropriate events.

0 Karma

syh
Engager

Ok, then where in the query should I add my source1?

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

Hi @syh,

You could do it multiple ways using join , subsearch etc . However easiest way is to use stats something similar to

index="your index" (source="source1" OR source="source2") 
|stats dc(source) as presence, values(*) as * by domains|where presence>1
Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...