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!

Congratulations to the 2025-2026 SplunkTrust!

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

[Puzzles] Solve, Learn, Repeat: Nested loops in Event Conversion

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...