Splunk Search

Stats issue with multivalue field

mbasharat
Builder

Hi,

I am tracking my assets with vulnerabilities. My minimized sample query is:

index=vuln
| stats dc(dns) as impacted_asset_count by Vuln_ID, CVE

When stats populate, it shows that one vulnerability is affecting multiple assets and several Vuln_IDs have multiple CVEs.

Sample:

alt text

As you notice, there are multiple CVEs in some Vuln IDs. I need to have CVEs seperated/expanded/extracted as they are multivalue field and then have correct stats. Each CVE is impacting more than one assets so, I need it like this:

alt text

Thanks in-advance!!!

Labels (2)
Tags (1)
0 Karma
1 Solution

mbasharat
Builder

I ended up using:

| makemv delim="," cve
| mvexpand cve

View solution in original post

0 Karma

mbasharat
Builder

I ended up using:

| makemv delim="," cve
| mvexpand cve

0 Karma

to4kawa
Ultra Champion
index=vuln
| stats dc(dns) as impacted_asset_count values(Vuln_ID) as Vuln_ID by CVE

This is better.
by extracts multi values

0 Karma

mbasharat
Builder

Hi @ to4kawa

This does not do it because cve is a multivalue field. AT minimum, it has one CVE and there are several vuln ids which have more than one CVE as shown in first screenshot. cves need to be extracted using regex or eval and then do stats will do it looks like. I will need regex or eval pls.

0 Karma

to4kawa
Ultra Champion

I see, my answer is updated

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...