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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...