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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...