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!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...