Splunk Search

Combine Like Fields from Sourcetypes in the Same Index

atebysandwich
Path Finder

I have two sourcetypes from the same index, both in JSON formatting.  One contains hosts and vulnerability scan data and the other contains hosts and host info. I ultimately want to tie the vulnerability data to the the hosts in the other sourcetype and create an outputlookup.

The matching field I would like to use is IP but the field names are different in each sourcetype. Sourcetype1 has the IP field named ipv4s{} and sourcetype2's IP field is called asset.ivp4. I have tried combing them using eval and coalesce but when I do, ipv4s{} will come up as the field value and not the IPs of the two previously mentioned fields. 

Here is the search I've been trying:

 

 

 

index=index (sourcetype=sourcetype1 OR sourcetype=sourcetype2
| eval IP=coalesce("ipv4s{}","asset.ipv4")

 

 

 

 

Labels (4)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

The big secret is quotation marks.

index=index (sourcetype=sourcetype1 OR sourcetype=sourcetype2
| eval IP=coalesce('ipv4s{}','asset.ipv4')

isoutamo
SplunkTrust
SplunkTrust

In splunk ” means value and ‘ means field name.

Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...