Splunk Search

ES Search Help - How do I multi index join when IP address field is named differently between the two indexes?

lou_sierra
New Member

I have looked at the join documentation, but I am getting a little lost in translation.
What I am trying to accomplish, is to pull data from Index1, then join on IP address to another index to pull different information and display all of it.

Example:

 

Index=firewall dest_port=21
| stats values(dest_ip) as dest_ip values(dest_port) as dest_port sum(bytes_in) as bytes_in sum(bytes_out) as bytes_out values(app) as app values(rule) as rule by user src _time

Index=edr RPort=21 RemoteIP=$dest_ip-from-first-search

 



The output should be a table with the following:
firewall._time, firewall.src, firewall.dest_ip, edr.username, edr.username, edr.processname

The issue I am running into is the IP address field is named differently between the 2 indices.  Ideally I would join on firewall.dest_ip TO edr.RemoteIP

Any help would be appreciated. 

Labels (1)
0 Karma

smurf
Communicator

Hi,

I usually just rename the join field at the end of the subsearch or create the join field in the original search with eval.

It could look something like this:

index=firewall
| fields firewall._time, firewall.src, firewall.dest_ip
| eval edr.RemoteIP = firewall.dest_ip
| join
[ index=edr
| fields edr.username, edr.username, edr.processname edr.RemoteIP ]

 

smurf

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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...