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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...