Reporting

How to use cron schedule or Search time range to run every half a month then 2nd report that runs the left over days

Cheng2Ready
Path Finder



Example:

1st report

Date is from 1st June~16th June

2nd report

Date is from 17thJune ~ 30 June

and have it send the two reports on the end of the beginning of the next month.  July 1st.

Next month rolls in....

1st report

Date is from 1st July~16th July

2nd report

Date is from 17th July ~ 31 July

and have it send two reports on the end of the beginning of the next month.  August 1st, ect... and so on.

Cheng2Ready_0-1724956779561.png

Cheng2Ready_0-1724958693827.pngCheng2Ready_1-1724958708205.png

 

 

Labels (1)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

I'm not quite sure what you mean but you can't use cron schedule to do different things in different periods (like every half an hour from 1am till 5pm and hourly in the rest of the day).

If you want two reports generated each month just schedule two reports every month (probably run a bit after the start of the month to account for any possibly delayed data). One would be over

earliest=-1mon@mon latest=-1mon@mon+16d

and another

earliest=-1mon@mon+16d latest=@mon

 

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Rather than try to run the report on the last day of the month, how about running it as soon as the month ends - the first day of the next month?

1 0 1 * *

I used minute 1 to avoid getting skipped during the overly-popular minute 0.

---
If this reply helps you, Karma would be appreciated.
0 Karma

Cheng2Ready
Path Finder

@richgalloway  yeah the only reason I'm splitting it into two sections is because when I did the logs for 1 month.
the exported excel sheet was missing data for some reason.
but when I split it in half in the search query the data is able to populate.
I guess the search query might have been too messy, much and adding on 1 month for it might have caused it to use to much resource or something.

Thank you

0 Karma

richgalloway
SplunkTrust
SplunkTrust

cron lets you schedule a report on the 16th day of a month, but not the 16th and last days.  You would need two reports for that.

Even if cron did what you seek, Splunk sends reports immediately.  There is no way to sit on the results before sending them other than to write the results to a summary index or CSV.  Then you would need two reports - one to search the first half of the month and write the summary; the second searches the rest of the month and incorporates the summary results into the final report.

---
If this reply helps you, Karma would be appreciated.
0 Karma

Cheng2Ready
Path Finder

@richgalloway 
Thank you for the response!
So lets say we go the path of creating two scheduled Reports
1.  a report on the 16th day of a month

How would I setup the 2nd query to search from 17~ 30  or 31 depending on the month?
would it look like this?

Cheng2Ready_0-1724963380375.png

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

I'm not quite sure what you mean but you can't use cron schedule to do different things in different periods (like every half an hour from 1am till 5pm and hourly in the rest of the day).

If you want two reports generated each month just schedule two reports every month (probably run a bit after the start of the month to account for any possibly delayed data). One would be over

earliest=-1mon@mon latest=-1mon@mon+16d

and another

earliest=-1mon@mon+16d latest=@mon

 

0 Karma

Cheng2Ready
Path Finder

I will give this a try Thank you @PickleRick 

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 ...