Splunk Search

How to timechart requests count with SLA and latency

panandshah
New Member

How to timechart requests count with SLA and latency based on the time mentioned in the logs. I need to know how many request ended within 50ms , 100 ms and 1 sec and the count of such request with percentage of contribution against the total request.

Sample Logs: Time is in seconds

10.30.2.154 [23/Nov/2017:14:59:49 +0530] "GET http://example.com/BYOD/besc/READSubHierarchyCount?channel=IOS&appVersion=5.23.1&categoryId=14846&gl... HTTP/1.1" 200 165 0.020027 miss - 75.156.33.2

10.30.1.91 [23/Nov/2017:14:59:49 +0530] "GET http://example.com/BYOD/besc/READAggregatedContentDetails?contentId=1000193399&appVersion=5.17.53&gl... HTTP/1.1" 200 1217 0.011564 miss - 71.59.21.249

10.30.3.143 [23/Nov/2017:14:59:49 +0530] "GET http://example.com/BYOD/besc/READSubHierarchyCount?channel=IOS&appVersion=5.23.1&categoryId=742&gl=C... HTTP/1.1" 200 164 0.019100 miss - 75.156.33.2

  1. Calls that took lesser than <= 50ms , calls between 50 ms to 200 ms and 200ms to 500ms and 500 ms to 1 second.
  2. Number of total request.
  3. percentage of req contribution against total request.

Here is one example of the output desired.

<= 50ms >50 To <=100 ms >100 to <=200 ms
Count % Count % Count %
556567 96.609 15223 2.642 3724 0.646
468026 99.821 539 0.114 153 0.032
216127 99.847 192 0.088 66 0.030
251327 99.758 374 0.148 112 0.044

Tags (1)
0 Karma

lukas_loder
Communicator
  1. | eval duration_group = if(duration<=50,"50ms",if(duration<=200,"200ms",if(duration<=500ms,"500ms","1s"))) so you have a new field_duration_group with that you can count
  2. | eventstats count as totalCount this one gives you on every event a new field with the total count

now you just can calculate the percentage

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...