Splunk Search

How to combine two timechart query that extract the difference ?

Maickeen
Engager

Query 1:

(index=iks) "Procces started" | timechart count span=1d

Query 2: 

(index=iks) "Procces finished" | timechart count span=1d

 

I want to display the result of Query 1 - Query 2 for each day

Labels (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Try like this

(index=iks) "Procces started" OR "Procces finished" 
| eval type=if(searchmatch("Procces started"),"Process_Started","Process_Finished")
| timechart count span=1d by type
| eval differenc=Process_Started-Process_Finished

View solution in original post

somesoni2
Revered Legend

Try like this

(index=iks) "Procces started" OR "Procces finished" 
| eval type=if(searchmatch("Procces started"),"Process_Started","Process_Finished")
| timechart count span=1d by type
| eval differenc=Process_Started-Process_Finished
Get Updates on the Splunk Community!

Developer Spotlight with Brett Adams

In our third Spotlight feature, we're excited to shine a light on Brett—a Splunk consultant, innovative ...

Index This | What can you do to make 55,555 equal 500?

April 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...