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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...