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 (3)
0 Karma
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 ...