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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...