Dashboards & Visualizations

Ongoing Patching Countdown

stevenbo
Explorer

Hello everyone, I am trying to use Splunk to create an ongoing patching countdown that will be Single Value (Days Until Patch) on my Dashboard. How can I go about accomplishing this? I was able to calculate 1 patch cycle, but I am not sure how to get it to recalculate for every month. Right now for example, it is telling me the next patch date is 2/29/2024. Hoping someone already has a solution built out. Thank you for any assistance! 

 

This is what I have so far:

| makeresults
| eval start= strptime("02-01-2024", "%m-%d-%Y")
| eval startStr=strftime(start, "%D")
| eval PatchDate = relative_time(start ,"+28d")
| eval PatchDateString= strftime(PatchDate, "%D")
| eval PriorPatchDate = relative_time(start ,"-28d")
| eval PriorPatchDateString = strftime(PriorPatchDate, "%D")
| eval daysCountD= strftime(PatchDate - now(), "%d")
| table daysCountD PriorPatchDateString PatchDateString
Labels (1)
0 Karma
1 Solution

burwell
SplunkTrust
SplunkTrust

How about something like this

| makeresults
| eval start= strptime("02-01-2024", "%m-%d-%Y")
| eval today=now()
| eval time_difference=floor((today-start)/(60*60*24))
| eval mod_val=time_difference % 28
| eval days_to_patch=28-mod_val

 

days_to_patch.png

View solution in original post

0 Karma

burwell
SplunkTrust
SplunkTrust

Hi so what's the patching schedule? Every 28 days starting in Feb 1?

0 Karma

stevenbo
Explorer

@burwell wrote:

Hi so what's the patching schedule? Every 28 days starting in Feb 1?


Sorry, yes. Every 28 days starting Feb 1. 

0 Karma

burwell
SplunkTrust
SplunkTrust

How about something like this

| makeresults
| eval start= strptime("02-01-2024", "%m-%d-%Y")
| eval today=now()
| eval time_difference=floor((today-start)/(60*60*24))
| eval mod_val=time_difference % 28
| eval days_to_patch=28-mod_val

 

days_to_patch.png

0 Karma

stevenbo
Explorer

@burwell wrote:

How about something like this

 

| makeresults
| eval start= strptime("02-01-2024", "%m-%d-%Y")
| eval today=now()
| eval time_difference=floor((today-start)/(60*60*24))
| eval mod_val=time_difference % 28
| eval days_to_patch=28-mod_val

 

 

days_to_patch.png


Thank you, I think this does exactly what I need! Greatly appreciated! 

0 Karma

burwell
SplunkTrust
SplunkTrust

Glad to hear this is what you needed. 

 

You can accept this solution to indicate the question was answered to your liking.  thanks!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...