Splunk Enterprise

peakTPS for every one hour in last 24 hours

appusplunk14
Engager

i am trying to find out peakTPS for every one hour in last 24 hours duration, i have below query but thats giving peak TPS only for one hour , how do i run that loop that query for entire 24 hours duration but need results for every one hour.

 

index=whatever |timechart span=1s count AS TPS avg(RT) as Avg_RT | eventstats max(TPS) as peakTPS | eval peakTime=if(peakTPS==TPS,_time,null()) | stats avg(TPS) as avgTPS first(peakTPS) as peakTPS first(peakTime) as peakTime |eval peakTPS=round(peakTPS,2), avgTPS=round(avgTPS,2) |table avgTPS peakTPS peakTime |convert timeformat="%Y-%m-%d %H:%M:%S %Z" ctime(peakTime) as peakTime

Labels (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @appusplunk14,

You can use the below query.  

index=whatever 
| bin _time span=1s 
| chart count as TPS by _time 
| timechart max(TPS) as peakTPS eval(round(avg(TPS),2)) as avgTPS span=1h

 

If this reply helps you, an upvote is appreciated.  

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @appusplunk14,

Below query will show peakTime too. 

index=whatever
| bin _time span=1s 
| chart count as TPS by _time 
| eval time_hour=strftime(_time,"%Y-%m-%d %H:00:00") 
| eventstats max(TPS) as peakTPS avg(TPS) as avgTPS by time_hour 
| eval avgTPS=round(avgTPS,2)
| where TPS=peakTPS 
| rename _time as peakTime, time_hour as _time 
| eval peakTime=strftime(peakTime,"%Y-%m-%d %H:%M:%S") 
| stats values(peakTime) as peakTime values(peakTPS) as peakTPS values(avgTPS) as avgTPS by _time
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

appusplunk14
Engager

thanks it worked , i would like to print peak time as well , is that possible?

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @appusplunk14,

You can use the below query.  

index=whatever 
| bin _time span=1s 
| chart count as TPS by _time 
| timechart max(TPS) as peakTPS eval(round(avg(TPS),2)) as avgTPS span=1h

 

If this reply helps you, an upvote is appreciated.  

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

appusplunk14
Engager

can you please help me to update query to get peak time as well ?

0 Karma

appusplunk14
Engager

any update on peakTime?

0 Karma
Get Updates on the Splunk Community!

Index This | What’s a riddle wrapped in an enigma?

September 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

BORE at .conf25

Boss Of Regular Expression (BORE) was an interactive session run again this year at .conf25 by the brilliant ...

OpenTelemetry for Legacy Apps? Yes, You Can!

This article is a follow-up to my previous article posted on the OpenTelemetry Blog, "Your Critical Legacy App ...