Splunk Search

Count of a large number of events by punct by minute

cpeteman
Contributor

So the intent is to have a field that returns the time stamp of a large number of similar events (same punct field) if it meets a certain condition. For example let's say the number of events in a minute with a certain punct is more than 100. I would like to get both the punct and the time stamp as fields. What I have right now and what should be a good start is:

search_terms | bucket _time span=1m | stats count by punct,_time | stats mean(count),count by punct |eval test=if(count>100,"True","False")

All this will do however is see if the total number of events with that punct is greater than 100 not if the number of events in a single minute. I'll also need the sime stamp but that's not a problem after I get this first part working.

Tags (3)
1 Solution

cpeteman
Contributor

Well this question was a little easy actually. looks like I didn't need to post it here. For those who are curious:

search_terms | bucket _time span=1m | stats count by punct,_time | stats mean(count),sum(count) AS sum by punct,_time |eval test=if(sum>100,"True","False")

All that was needed was for me to use sum(count) and add a _time field. Cheers!

View solution in original post

cpeteman
Contributor

Well this question was a little easy actually. looks like I didn't need to post it here. For those who are curious:

search_terms | bucket _time span=1m | stats count by punct,_time | stats mean(count),sum(count) AS sum by punct,_time |eval test=if(sum>100,"True","False")

All that was needed was for me to use sum(count) and add a _time field. Cheers!

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...