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.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...