Splunk Search

Using the Splunk Tutorial data, how to edit my search to calculate the cart to purchase percentage by productId?

rishabh4
New Member

Using eval command, how would I calculate the cartToPurchase percentage by product?

sourcetype=access* status=200 action= purchase OR view  | stats count(eval(match("purchase cart"))) AS carttopurchase |stats count AS total | eval percent=(carttopurchase/total)*100 

Please help me to execute the search and please don't close this question as i am in serious need for the answer.

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try like this

sourcetype=access_* status=200 | chart count(eval(action="addtocart")) AS addtocart count(eval(action="purchase")) AS purchases by productName | eval percent=(purchases/addtocart )*100 

View solution in original post

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try like this

sourcetype=access_* status=200 | chart count(eval(action="addtocart")) AS addtocart count(eval(action="purchase")) AS purchases by productName | eval percent=(purchases/addtocart )*100 
0 Karma

skoelpin
SplunkTrust
SplunkTrust

Can you close out the other question you asked (Accept an answer) which is very similar to this one?

0 Karma

rishabh4
New Member

bro please help in this question i need to calculate the percentage and also for % i need to calculate the arguments for it.
help

0 Karma

rishabh4
New Member

please answer here brother please i need it

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