Splunk Search

Appending 2 searches but 1 search doesnt contain values after certain time

balash1979
Path Finder

I got the answer for my previous question here : https://community.splunk.com/t5/Splunk-Search/Join-searches-and-make-a-calculation/m-p/545615#M15458...

Here is my current search 

 

<search A>  
| bin span=1d _time
| stats count max(size) AS Users_Waiting by _time
| append [search <search B> 
  | bin span=1d _time
  | stats count as Daily_Users by _time
  | streamstats sum(Daily_Users) as Cumulative_Users ]
| stats values(*) as * by _time
| eval Users_Not_Waiting = Cumulative_Users - Users_Waiting
| timechart span=1d Users_Not_Waiting

 

The issue that I am having is the following: 

Search A - Has events for the last 9 days so I can get Users_Waiting data

Search B - Doesnt have events for the last 2 days so I dont get any data 

Because Search B doesnt have events for the last 2 days, when I do the eval, I am not able to difference for the last 2 days.
I want Search B (which is cumulative data) to continue to show 3765156 so the diff is calculated.

balash1979_0-1616939433649.png

 

 

Labels (1)
0 Karma
1 Solution

tscroggins
Influencer

@balash1979 

You can add the filldown command  to your search to propagate the last Cumlative_Users value before calculating Users_Not_Waiting:

| filldown Cumulative_Users
| eval Users_Not_Waiting = Cumulative_Users - Users_Waiting

 

View solution in original post

tscroggins
Influencer

@balash1979 

You can add the filldown command  to your search to propagate the last Cumlative_Users value before calculating Users_Not_Waiting:

| filldown Cumulative_Users
| eval Users_Not_Waiting = Cumulative_Users - Users_Waiting

 

Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

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

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...