Splunk Search

How to compute the value of 2 different complex queries

renataque
New Member

Ok, so I want to see the ratio between "interview.completed" and "interview.started", but filtering each event by unique interviewCode

Currently, each separate search looks like this:

Search for unique interviews started:
source="http:Tracker" | spath "message.environment" | search "message.environment"=production | spath eventName | search eventName="pre-record.candidate.interview.start" | spath interviewCode | search interviewCode=* | dedup interviewCode | timechart span=1w count by eventName
Result 6

Search for unique interviews completed:
source="http:Tracker" | spath "message.environment" | search "message.environment"=production | spath eventName | search eventName="pre-record.candidate.interview.completed" | spath interviewCode | search interviewCode=* | dedup interviewCode | timechart span=1w count by eventName
Result 1

How can I create a chart that displays both values side by side?

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Try this

source="http:Tracker"   | spath "message.environment"   | search "message.environment"=production | spath eventName | search eventName="pre-record.candidate.interview.start" OR eventName="pre-record.candidate.interview.completed"| spath interviewCode | search interviewCode=* | dedup eventName interviewCode | timechart span=1w count by eventName

View solution in original post

0 Karma

somesoni2
Revered Legend

Try this

source="http:Tracker"   | spath "message.environment"   | search "message.environment"=production | spath eventName | search eventName="pre-record.candidate.interview.start" OR eventName="pre-record.candidate.interview.completed"| spath interviewCode | search interviewCode=* | dedup eventName interviewCode | timechart span=1w count by eventName
0 Karma

Richfez
SplunkTrust
SplunkTrust

It looks like you might be able to just take where you do

... | search eventName="pre-record.candidate.interview.start"

and

... | search eventName="pre-record.candidate.interview.completed"

And combine them into one where you search for either.

... | search eventName="pre-record.candidate.interview.start" OR  eventName="pre-record.candidate.interview.start

That should get you both on one set of results.

0 Karma

renataque
New Member

Hi Rich, thanks for your reply.

I have tried using "OR" but the result of that query is only one number and what I want is a chart where I can see both numbers:

Interviews started by unique interviewCode = 6
Interview completed by unique interviewCode = 1

Meaning my completion rate is 1/6 = 16%

0 Karma
Get Updates on the Splunk Community!

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...