Splunk Search

How to calculate the percentage of certain field occurence in the events ?

zacksoft_wf
Contributor

In my events, there is a field called "is_interactive"  which has value of either 0 or 1.
Now the thing is, not all of my events has the field "is_interactive" in them.
How to do I know, how much of of my events have this field in them ?

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

stats count(is_interactive)

| makeresults count=20 
| eval is_interactive=random()%2
| eval is_interactive=if(random()%2 == 0,null(),is_interactive)
``` the lines above generate some random dummy data ```
| stats count count(is_interactive) as interactive sum(is_interactive) as total

This show total count, those events where is_interactive is not null, and the sum of the is_interactive to show that some of the is_interactive values are zero

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...