Splunk Enterprise Security

Percent problems

jacqu3sy
Path Finder

Hi,

Struggling to get the percentage to work properly...

I have 3 fields; Open, Closed and New.

I want to report on the percentage of events which have a status of either Closed or Open.

Trying to play with the following but cant get it working;

| eval actioned=if(in(status_group,"Open", "Closed"),"true","false")
| stats count by actioned
| eventstats sum(count) as total
| eval percent= round ( count*100/total,1)
| gauge percent 0 40 60 100
| fillnull value=0

Any ideas? Thanks.

0 Karma

lakshman239
Influencer

You could do something like the below, as you are interested in Open/Closed only

| eval percent= round ( if(actioned="true",count*100/total,0),1) | search percent > 0  
| gauge percent 0 40 60 100 
| fillnull value=0
0 Karma
Get Updates on the Splunk Community!

Video | Welcome Back to Smartness, Pedro

Remember Splunk Community member, Pedro Borges? If you tuned into Episode 2 of our Smartness interview series, ...

Detector Best Practices: Static Thresholds

Introduction In observability monitoring, static thresholds are used to monitor fixed, known values within ...

Expert Tips from Splunk Education, Observability in Action, Plus More New Articles on ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...