Splunk Search

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

khayamgondal
Engager

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 

0.1

0.03

0.34

0.32

Labels (3)
0 Karma

somesoni2
SplunkTrust
SplunkTrust

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...