Splunk Search

calculate overall total stats after certain date from other field

dhavamanis
Builder

Can you please help me to get the stats after July 16th 2018 from other column value sum. We had a valid data from starting to July 16th and after that Overall_Total coming as 0 and we need to calculate overall total from other column "Daily_Count".

sample data,

Date,Brand,Daily_count,Overall_Total
01/01/2018,xxx,20,1500
02/01/2018,yyy,10,100
07/16/2018,xxx,10,1510
07/16/2018,yyy,20,120
07/17/2018,xxx,40,0
07/17/2018,yyy,30,0

Can you please help me to get overall total with previous max + after July 16th Daily_Count.
Expected result,

07/17/2018,xxx,40,15500
07/17/2018,yyy,30,150

Tags (1)
0 Karma

Vijeta
Influencer

Try something like this-

 <your query>| eval x=if(Date>"07/16/2018", Daily_count,0)| eval Total=x + Overall_Total| stats latest(Date) as Date , sum(Total) as Overall_Total, sum(x) as Daily_count by Brand
0 Karma
Get Updates on the Splunk Community!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...