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
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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...