Splunk Search

Compound Search with two sourcetypes

hartfoml
Motivator

I want to search for an IDS event like this

sourcetype=IDS "MALWARE-CNC"

Then I want to use the src_IP and dst_IP to search the proxy logs to see if the proxy blocked the traffic. Something Like this I would think

sourcetype=IDS "MALWARE-CNC" | fields src_ip dst_ip [ search sourcetype=proxy src_ip dst_ip action!=DENIED]
Tags (3)
0 Karma

jonuwz
Influencer

nearly : )

sourcetype=proxy action!=DENIED [ search sourcetype=IDS "MALWARE-CNC" | fields src dst | dedup src dst | rename src as src_ip dst as dst_ip ]

Edit missed out "search" in the sub search

0 Karma

jonuwz
Influencer

whoops - updated answer ....

0 Karma

hartfoml
Motivator

Nick thanks for the help. Here is the search I used

sourcetype="bcoat_proxysg" action!=TCP_DENIED [ sourcetype=IDS "MALWARE-CNC" | fields src dst | dedup src dst | rename src as src_ip dst as dst_ip ]

I get this error "Search operation 'sourcetype' is unknown. You might not have permission to run this operation."

0 Karma

theouhuios
Motivator

rename should do that.

0 Karma

sideview
SplunkTrust
SplunkTrust

Assuming it's dst and dst_ip on the destination side, it's as follows:

sourcetype=proxy action!=DENIED [ sourcetype=IDS "MALWARE-CNC" | fields src dst | dedup src dst | rename src as src_ip dst as dst_ip ]

0 Karma

hartfoml
Motivator

Also using the transforms I have in right now the IDS uses "src" for the source IP and the proxy uses "src_ip".

How would I right the search to convert the IP from one tag to another for the subsearch?

0 Karma

sideview
SplunkTrust
SplunkTrust

When a subsearch is processed, it's the inner subsearch that is run first, so in jonuwz's example, the malware-cnc search is processed first, and it's only the src and dest ip's of the malware search IP's that are then searched for in the proxy data.

0 Karma

hartfoml
Motivator

If I get the IDS alert and it is not denied by the proxy then an exploit is at hand. If the traffic is denied I can look at it later and don't need the alert right now.

So the !DENIED will generate an event that I can alert on.

0 Karma

theouhuios
Motivator

If you are looking for just one, then why use "NOT DENIED"? Instead you can use that same value to search on. Try to create your searches in as positive as possible manner. It will help in performance.

0 Karma

hartfoml
Motivator

So why do I put the proxy search first? there are lots of "Not DENIED" logs to look through and I am only looking for one. Why not find the IP in IDS and pass to the proxy search?

0 Karma
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...