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!

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...