Splunk Search

Peak hours of the week by total daily percentage

SecureIA
Path Finder

Hi,

I need to display the peak times of day that events are occurring. Essentially, I want to find out the peak times of the week that people are logging into my web application but I want to display this by the percent of the daily total

I have my search here - host="" AND "" AND "GET" AND "" This brings the results that I need.

Any help with this would be massively appreciated.

Cheers,
Lee

0 Karma
1 Solution

rjthibod
Champion

Try this. You can change the span component to get higher or lower resolution.

sourcetype=iis
| timechart span=15m dc(cs_username) as count
| eval day = tonumber(strftime(_time,"%j")) 
| fillnull value=0 count 
| eventstats sum(count) as day_total by day 
| eval perc = round(100* (count/day_total),2) 
| fields - count day day_total

View solution in original post

0 Karma

SecureIA
Path Finder

Thank you so much for your reply. I'm sorry my example search was wrong.

My original search is - sourcetype=iis | eval users=cs_username | timechart span=1d dc(users)

Would this change the search string much? I have replaced count with dc(users) in the hope that it would work

0 Karma

rjthibod
Champion

I updated my original answer to reflect your search. Please respond to my answer using the "Add Comment" link below it if you have more questions or issues. Otherwise, please accept the answer if it works for you.

0 Karma

rjthibod
Champion

Try this. You can change the span component to get higher or lower resolution.

sourcetype=iis
| timechart span=15m dc(cs_username) as count
| eval day = tonumber(strftime(_time,"%j")) 
| fillnull value=0 count 
| eventstats sum(count) as day_total by day 
| eval perc = round(100* (count/day_total),2) 
| fields - count day day_total
0 Karma

SecureIA
Path Finder

That is exactly what I needed. Thank you so much!!

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...