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
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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...