Splunk Search

How to Calculate the product of a numeric field (multiplication)?


I have a field with the following values. How can I calculate the product i.e multiply all values with each other? There is a sum function but no multiplication. The output should be = 0.1*0.03*0.34*0.32. Thanks 





Labels (3)
0 Karma

Revered Legend

Will something like this work for you?

| makeresults | eval t="0.1 0.03 0.34 0.32" | makemv t | mvexpand t 
| streamstats count | eval count="TTT".count | xyseries _time count t | eval multiply=1 | foreach TTT* [| eval multiply=multiply*'<<FIELD>>'] | table multiply

 (first line to generate sample data). 

0 Karma
Get Updates on the Splunk Community!

Security Highlights: September 2022 Newsletter

 September 2022 The Splunk App for Fraud Analytics (SFA) is now Splunk SupportedUse your existing Splunk ...

Platform Highlights | September 2022 Newsletter

 September 2022 What’s New in 9.0 and How to UpgradeGet a walk through of what is new Splunk Enterprise 9.0 ...

Observability Highlights | September 2022 Newsletter

 September 2022 Splunk Observability SuiteAccess to "Classic" SignalFx Interface Will be Removed on Sept 30, ...