Splunk Search

How to compare single value field from index 1 with that of multivalue field in index 2 and display the results?

Navanitha
Path Finder

Hi,

I am trying to correlate two security indexes and display the output. Index 1 has a CVE_Id and index 2 also has "cve" id but it has multiple values in the same event which are comma separated. Can someone help me write a search query to join these two indexes with CVE as common field. for ex: index 1 has CVE_ID="xyz" and index 2 has cve=xyz, abc, efg, jkl. making cve as common field I want to compare these two indexes and display fields CVE, signature, title.

Thank you

Tags (3)
0 Karma

mayurr98
Super Champion

Try this :

index=index1 OR index=index2 
| makemv cve delim="," 
| mvexpand cve 
| eval CVE=coalesce(CVE_ID,cve) 
| stats values(title) as Title values(signature) as Signature by CVE
0 Karma

solarboyz1
Builder

How about the following:

   (index=1 OR index=2) 
  | eval cve=if(isnotnull(cve), cve, CVE_ID)
  | mvexpand cve
  | stats values(title), values(signature) by cve
0 Karma

Sukisen1981
Champion

something like this:

(index=1 OR index=2)|stats values(cve_id) as cve_id by index | mvexpand cve_id|eventstats count as count_cve by cve_id|where count_cve>1

assumption - cve_id name is common in both indexes, if not rename in one index and make it common

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...