Splunk Search

How to create a time chart on response times for multiple services?

abc_
New Member

I want to display the response time of 2 different transactions (or 2 events). Let's say, first transaction/event is combination of 2 rest services, and second transaction is a different service call. I can identify these all rest services using their service urls. Also, for the first transaction, response time will be considered as the sum of "average response time of each rest service response time".

0 Karma

somesoni2
Revered Legend

Without your current query/details on how your data looks like, give this a try

your base search url=restservicecall1 OR url=restservicecall2 OR url=restservicecall3 | eval transaction=if(url="restservicecall3" ,"Transaction2","Transaction1") | timechart avg(response_time)  by transaction
0 Karma

sundareshr
Legend

Let's say your REST services are called svc1, svc2 & svc2. Try this

base search | bin span=1h _time | stats avg(eval(RESTURL="svc1") as svc1_avg avg(eval(RESTURL="svc2") as svc2_avg avg(eval(RESTURL="svc3") as resp_txn2 by _time | eval resp_txn1=svc1_avg+svc2_avg | table resp_txn1 resp_txn2
0 Karma

abc_
New Member

I tried it. It is giving error saying "Error in 'bin' command: Invalid argument: 'stats'"

0 Karma

sundareshr
Legend

Try updated answer.

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...