Splunk Search

How to append a single value to multiple rows in my table?

ashishlal82
Explorer
base search| mvexpand Name | stats dc(Name) as totalcve by severity | appendcols [|inputlookup lookupname| stats count(Name) as TotalCVE] |eval perc=tostring(totalcve/TotalCVE*100, "commas")."%

I have a search that outputs below table

Severity    totalCVE    TotalCVE    perc
High        2000        10000       20%
Medium      1000
Low         500

How can I append a single value (TotalCVE) to multiple rows and get perc for medium and low severities?

0 Karma

somesoni2
Revered Legend

Give this a try

 base search| mvexpand Name | stats dc(Name) as totalcve by severity | eval TotalCVE=[|inputlookup lookupname| stats count(Name) as search ] |eval perc=tostring(totalcve/TotalCVE*100, "commas")."%

richgalloway
SplunkTrust
SplunkTrust

Try ... | filldown TotalCVE | eval perc=....

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...