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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...