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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...