Splunk Search

Help with Sub Searches

rmcdougal
Path Finder

I am attempting to search our networking logs based off the snort alert logs but I can't figure out how to perform the sub search correctly. This is what I have so far:

sourcetype=snort | eval snort_src=src_ip | eval snort_dest=dest_ip [search sourcetype=cisco_asa dest_ip=snort_destip | table NAT_Address] | table snort_src, snort_dest, NAT_Address

So basically this is what I want to accomplish

  1. Return all Snort alerts
  2. Rename the Snort src_ip field to snort_src (this is because the same field exists in the cisco logs)
  3. Rename the Snort dest_ip field to Snort_dest
  4. Search the Cisco logs for matches based on the snort dest_ip
  5. Return NAT Address field
  6. Table Snort_src, Snort_dest, NAT_Address
Tags (1)
0 Karma

bmacias84
Champion

Hello @rmcdougal, I am assuming your field extraction exists for all fields for your sources. Also I think you need do some reading on search operations and sub searches. Here is how I might approach the problem, keep in mind I dont have the same data that you are using.

I also assume dest_ip exists in both sourcetypes. You may have to do work with time.


sourcetype=snort OR sourcetype=cisco_asa | selfjoin dest_ip | table src_ip, dest_ip, NAT_Address

or

sourcetype=snort | fields _time,src_ip, dest_ip| join dest_ip [search sourcetype=cisco_asa | fields _time,dest_ip, NAT_Address ]

or

sourcetype=snort OR sourcetype=cisco_asa | transaction dest_ip maxspan=5s | fields src_ip, dest_ip, NAT_Address

Consider reading Exploring Splunk Se4arch Processing Language (SPL)

I hope you this helps or gets you started. dont forget to accept or vote up answers. Cheers.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

All Work and No Play? Not at .conf26! Unwind at These Evening Events

Between hands-on technical sessions, keynote reveals, and diving into live architectures, .conf26 is packed ...

Join the Hackathon at .conf26 and build a No-Code AI agent

Join us for the AI Agent Buildathon, an in-person, three-hour hands-on Hackathon where you’ll use Splunk Agent ...