Reporting

Change report sending time logic

AdrianMCZ
Explorer

I have a report where it counts the events for the "next weekend", this meaning the following:

1.“Weekend” is considered the interval between Friday - 4 pm and Monday - 8 am.

2.: “Next” is to be considered with this rule: from Monday to Thursday, is the coming week and from Friday to Sunday, is the weekend after the next one.

Example: before June, Friday 4th, the interval 4/6 - 7/6 is considered the next weekend, on Friday 4th the interval 4/6 - 7/6 becomes this weekend , 11/6 – 14/6 becomes next weekend.

Issue: The report is scheduled at 8AM each day, but the Friday one is not considering the upcoming weekend as the "next weekend", rather taking the future weekend which will take place in 7 days.

I need help in understanding how to change the logic of this report, to have it also on Friday filled with the next weekend results, meaning the first and second day right after. Hope it makes sense.

 

| eval start = strptime( 'Scheduled Start' ,"%Y-%m-%d %H:%M") 
| eval end = strptime( 'Scheduled End' ,"%Y-%m-%d %H:%M") 
| eval "Scheduled Start" = strftime(start , "%Y-%m-%d %H:%M") 
| eval "Scheduled End" = strftime(end , "%Y-%m-%d %H:%M") 
| eval nextFriday =if( strftime(now(),"%w")=="5" OR strftime(now(),"%w")=="6" OR strftime(now(),"%w")=="0",relative_time(now() , "+1w@w5+16h"), relative_time(now() , "@w5+7d+16h"))  
| eval nextMonday = relative_time(nextFriday , "+3d@d+8h") 
| eval nextMondayS = strftime(nextMonday , "%Y-%m-%d %H:%M") 
| eval nextFridayS1 = strftime(nextFriday , "%Y-%m-%d %H:%M") 
| where start >= nextFriday AND start <= nextMonday 

 

 

 

Labels (2)
0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...