Splunk Search

How to get upcoming friday date

vb1612
New Member

I have a date field in my feed as "2/15/2019" , want to compare this with upcoming friday date value in search.
please help how to do this

Tags (1)
0 Karma
1 Solution

renjith_nair
Legend

@vb1612,

To get next friday, you can use

|eval next_friday=relative_time(now(),"+1w@w5")

To get the difference ,

"your base search"
|eval give_date_in_epoch=strptime("2/15/2019","%m/%d/%Y")
|eval next_friday=relative_time(now(),"+1w@w5")
|eval diff=next_friday-give_date_in_epoch

Feel free to change the variable names.

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

renjith_nair
Legend

@vb1612,

To get next friday, you can use

|eval next_friday=relative_time(now(),"+1w@w5")

To get the difference ,

"your base search"
|eval give_date_in_epoch=strptime("2/15/2019","%m/%d/%Y")
|eval next_friday=relative_time(now(),"+1w@w5")
|eval diff=next_friday-give_date_in_epoch

Feel free to change the variable names.

---
What goes around comes around. If it helps, hit it with Karma 🙂
Get Updates on the Splunk Community!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...