Splunk Search

Combine Like Fields from Sourcetypes in the Same Index

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


The big secret is quotation marks.

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


In splunk ” means value and ‘ means field name.

Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

 (view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...