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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...