Splunk Search

Finding the busiest hour of the day with timespan and ignore hours with zero events

MHS
Explorer

I use the following query against a Cisco as5400 to find the number of calls per hour during a day.

10.200.90.19 Called Number Voice-Interface | timechart span=1h count(Number) | sort - count(Number)

I want to run this query over multiple days and compare the hours over multiple days to tell me the busy hour. I also want to ignore any hours that return a count of zero.

Tags (1)
0 Karma
2 Solutions

dskillman
Splunk Employee
Splunk Employee

Would this work?

10.200.90.19 Called Number Voice-Interface | timechart span=1h count(Number) as num_count | where num_count > 0 | sort - num_count 

View solution in original post

Dan
Splunk Employee
Splunk Employee

date_hour is a default field. You could do:

... earliest=-7d | stats count by date_hour

This is something that you probably don't want to do ad-hoc. I recommend summary indexing: http://docs.splunk.com/Documentation/Splunk/5.0/Knowledge/Usesummaryindexing

View solution in original post

Dan
Splunk Employee
Splunk Employee

date_hour is a default field. You could do:

... earliest=-7d | stats count by date_hour

This is something that you probably don't want to do ad-hoc. I recommend summary indexing: http://docs.splunk.com/Documentation/Splunk/5.0/Knowledge/Usesummaryindexing

MHS
Explorer

OK, that did exactly what I wanted. Thanks for the link for summary indexing as well.

0 Karma

dskillman
Splunk Employee
Splunk Employee

Would this work?

10.200.90.19 Called Number Voice-Interface | timechart span=1h count(Number) as num_count | where num_count > 0 | sort - num_count 

MHS
Explorer

That got rid of the 0 count events....NICE

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...