Splunk Search

How to search a list of URLs and add the response times for URLs with similar patterns?

Karan_Jindal
New Member

Hi,

I have a Splunk search which gives list of URLs and their corresponding response times like:

/webapp/store/p/product1, 1
/webapp/store/p/product2, 2
/webapp/store/p/product3, 1
/webapp/store/l/list1, 1.12
/webapp/store/l/list2, 0.12
/webapp/store/home, 1.12
/webapp/store/page4, 1.12
/webapp/store/page5, 1.12

Now, I want to do a pattern search on these urls and want to add the response times of similar patterned urls.

Desired output:

/webapp/store/p/, 4
/webapp/store/l/, 1.24
/webapp/store/home, 1.12
/webapp/store/page4, 1.12
/webapp/store/page5, 1.12

Any help would be appreciated.

Thanks

Tags (4)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This should get you started:

... | rex field=URL "(<?PbaseURL>\/\w+\/\w+\/\w+)" | stats sum(time) as totalTime by baseURL | table baseURL totalTime
---
If this reply helps you, Karma would be appreciated.
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Try this:

base search | rex field=url "^(?<pattern>/[^/]+/[^/]+/[^/]+/?)" | stats sum(response_time) by pattern
0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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