Splunk Search

Calculate max min average response time and Peak hour by URL

shashank_24
Path Finder

Hi, I am trying to put together a table like this - Need to calculate the max TPM, max response time and average response time

urlmax_per_hourtotal_countAverageRespTimeMaxRespTime
/test13141514  
/test27772876  
     

 

My peak hour count and total count are coming but AverageRespTime and MaxRespTime are blank. I want to calculate this for last 30 days and below is the query I am using -

 

index=myindex sourcetype=access_combined_wcookie status=200 
| bucket span=1h _time 
| stats count as hour_count by _time url 
| stats max(hour_count) as max_per_hour sum(hour_count) as total_count avg(time_serve) as AverageRespTime max(time_serve) as MaxRespTime by url

 

Can someone advice what I am doing wring here OR may be some other way to achieve this task?

NOTE - time_serve field is available in my interesting fields.

Labels (2)
Tags (2)
0 Karma

anilchaithu
Builder

@shashank_24 

 

time_serve field is not available for the second stats command 

0 Karma

shashank_24
Path Finder

@anilchaithu It is available. Sorry I should have mentioned it.

0 Karma

anilchaithu
Builder

@shashank_24 

The output from first stats command will be the output for second stats command.

In this query the first stats command output hour_count, _time & url. So the time_server is not available for the second stats command

| stats count as hour_count by _time url
| stats max(hour_count) as max_per_hour sum(hour_count) as total_count avg(time_serve) as AverageRespTime max(time_serve) as MaxRespTime by url

index=myindex sourcetype=access_combined_wcookie status=200 
| bucket span=1h _time 
| stats count as hour_count by _time url 
| stats max(hour_count) as max_per_hour sum(hour_count) as total_count avg(time_serve) as AverageRespTime max(time_serve) as MaxRespTime by url

 

hope this clears your doubt

0 Karma

shashank_24
Path Finder

@anilchaithu ah yes you are right. Thanks. So how do i achieve it?

Because I want to display in a tabular format with along with the url's.

0 Karma

anilchaithu
Builder

@shashank_24 

try this 

| stats count as hour_count avg(time_serve) as avg_timeserve max(time_serve) as max_timeserve  by _time url
| stats max(hour_count) as max_per_hour sum(hour_count) as total_count avg(avg_timeserve) as AverageRespTime max(max_timeserve ) as MaxRespTime by url

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...