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!

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