Splunk Search

How to edit my search to find peak Transactions Per Second (TPS) per 30 minutes by host?

kualo
Explorer

Hi

I would like to calculate peak TPS per 30 minute by host.

I have this search.

some search| timechart span=1s count as TPS | timechart span=30m max(TPS) as PEAK

I have this, but if I add by host, it won't show any result.

Is there any way I can solve this problem?
Thanks!

0 Karma
1 Solution

esix_splunk
Splunk Employee
Splunk Employee

Typically you shouldnt chain together timecharts like this...

You can manipulate you time buckets with the bin/bucket command..

search | bucket span=1s _time | timechart xxxx

But im not sure why you are looking at one second here and then a 30 minute span. This effectively causes double processing and for no good reason. Is your events per second? If youre looking for the max, per host:

... search | bucket span=1s  | stats avg(TPS) as avg1s by _time host  | bin span=30m | timechar max(avg1s) as PEAK by host

That would generally be a way to do it. The first stats is looking at the per second avg split by time and host. The second groups it into 30mins, and groups the max by host.

View solution in original post

esix_splunk
Splunk Employee
Splunk Employee

Typically you shouldnt chain together timecharts like this...

You can manipulate you time buckets with the bin/bucket command..

search | bucket span=1s _time | timechart xxxx

But im not sure why you are looking at one second here and then a 30 minute span. This effectively causes double processing and for no good reason. Is your events per second? If youre looking for the max, per host:

... search | bucket span=1s  | stats avg(TPS) as avg1s by _time host  | bin span=30m | timechar max(avg1s) as PEAK by host

That would generally be a way to do it. The first stats is looking at the per second avg split by time and host. The second groups it into 30mins, and groups the max by host.

kualo
Explorer

Thanks! It works!

0 Karma

somesoni2
Revered Legend

Try like this

some search | bucket span=1s | stats count TPS by _time host | timechart span=30m max(TPS) by host
0 Karma
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 ...