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!

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 ...