Splunk Search

How to get results for how often each alarm type occurs in percentage

marenastrauss
New Member

I have uploaded alarm logs into Splunk. I would like to be able to show results for how often each alarm type occurs in percentage.

For example, the percentage of total alarms that Alarm 1 makes up and the percentage that Alarm 2 takes up, to see which alarm occurs more.

Thank you!

0 Karma
1 Solution

renjith_nair
Legend

@marenastrauss ,

In general , below should work

"your search"|stats count by alarm_type|eventstats sum(count) as total | eval perc=round((count/total)*100)
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@marenastrauss ,

In general , below should work

"your search"|stats count by alarm_type|eventstats sum(count) as total | eval perc=round((count/total)*100)
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

marenastrauss
New Member

That worked! I had to do it without round though because then it only gives back 0's. Thank you!

0 Karma

Sukisen1981
Champion

hi @marenastrauss
Then please accept the answer of @renjith.nair

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

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

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...