Splunk Search

How to go about stats count by a values between a range?

jenkinsta
Path Finder

I am trying to return data for a pie chart with a specified range of values. How would I go about this? 

 

| stats count(Score < 5) as "0-4.9" count(Score >=5 AND Score <=8) as "5-8"

 

Labels (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

here is link / example how you should do it.

In your case something like

 

 | stats count(eval(Score < 5)) as "0-4.9" count(eval(if(Score >=5 AND Score <=8),1,0)) as "5-8"

 

r. Ismo 

0 Karma

jenkinsta
Path Finder

THanks got it to work without the if statement was almost there just didnt think about the eval for that. 

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...