Splunk Search

How to get ratio of different values in the same field?

constantinetabs
New Member

How do I get the ratio for two values of the same field? When I run the following command:

host=web_app action=* file=* status=200
| stats dc(JSESSIONID) BY action

I get the followin output:

alt text

How could I get the ration of purchase and view action? What I want to see is how many people viewed the products and how many of them actually bought a product.

0 Karma
1 Solution

to4kawa
Ultra Champion
host=web_app action=* file=* status=200
| eval action = if(action = "purchase" OR action = "view", "p & v", action)
| stats dc(JSESSIONID) BY action

hi, how about this?

View solution in original post

0 Karma

to4kawa
Ultra Champion
host=web_app action=* file=* status=200
| eval action = if(action = "purchase" OR action = "view", "p & v", action)
| stats dc(JSESSIONID) BY action

hi, how about this?

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...