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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...