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
SplunkTrust
SplunkTrust

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...