Splunk Search

Getting count of field instead of a list of them

rkaakaty
Path Finder

Hello,

I am getting a stack of CVE field values, I just wanted to display the number of them (count). Here is my code:

index=nessus cve=*
| eval CVSS_SCORE = cvss_base_score + cvss_temporal_score
| eval description=substr(description,1,100)
| eval solution=substr(solution,1,100)
| rename id as ID, cve as CVE, plugin_name as Plugin_Name, description as  Description, solution as Solution
| table ID, Plugin_Name, Description, CVE, Solution, CVSS_SCORE
| sort - CVSS_SCORE

This is what it looks like alt text

Tags (1)
0 Karma

DalJeanis
Legend
| stats count as CVECount

or

| stats dc(CVE) as CVECount

You don't really need much of that if all you want is the count of CVEs...

 index=nessus cve=*
 | fields cve
 | dedup cve 
 | stats dc(cve) as CVECount

And if cve is an indexed field, then tstats would probably be more efficient

tstats where index=nessus AND cve=*
| stats dc(cve) as CVECount
0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

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

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...