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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...