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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...