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!

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...

Observability protocols to know about

Observability protocols define the specifications or formats for collecting, encoding, transporting, and ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...