Splunk Search

Grouping transactions with respect to duration

gpanicker
Explorer

I am looking for a query to group a set of transactions with respect to their duration. The output should be like this.

Duration Count


0-1 200
1-2 50
2-3 10

etc..

Tags (2)
0 Karma
1 Solution

dwaddle
SplunkTrust
SplunkTrust

As Yann was mentioning, once you have the duration value from transaction you can use rangemap to do something like this:

... | rangemap field=duration 0-10=0-10 11-100=11-100 100-500=100-500 default=500+ 
| stats count by range

View solution in original post

dwaddle
SplunkTrust
SplunkTrust

As Yann was mentioning, once you have the duration value from transaction you can use rangemap to do something like this:

... | rangemap field=duration 0-10=0-10 11-100=11-100 100-500=100-500 default=500+ 
| stats count by range

gpanicker
Explorer

Thanks! I get some overlapping ranges and it gets displayed as

Range Count
2-3 3-4 78
4-5 3-4 98

Is there any way to get the overlapped duration value assigned to a unique range.
for eg , duration of 2 should show up in 2-3 range and not in 1-2.

0 Karma

yannK
Splunk Employee
Splunk Employee

If you use the transaction function, the duration field exists.
So you have to redefine ranges with a new field like "durationrange" (see eval functions or rangemap)
http://docs.splunk.com/Documentation/Splunk/4.3.2/SearchReference/Rangemap

Finally use "| sort -durationrange" at the end of the search.

gpanicker
Explorer

Thanks! Is there any way to deal with the overlapped values.More details in the comment below...

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...