Splunk Search

How can I start each week from tuesday?

nikita012
New Member

Below is my code. It starts each week from sunday. How can start each week from tuesday? Do I need to change anything in +1w@w?

| eval weeknum=strftime(relative_time(strptime(Date,"%d-%b"),"+1w@w"),"%Y/%V")

Tags (2)
0 Karma
1 Solution

niketn
Legend

@nikita012 seems like this is a followup question to your previous question. https://answers.splunk.com/answers/738645/convert-week-number-to-the-1st-date-in-that-week.html

You can use the following snap-to setting to set to Tuesday "-0w@w+2d". Also if your previous question is resolved kindly accept/upvote that as well.

| eval WeekStartDate=strftime(relative_time(strptime(MinTime,"%m/%d/%Y"),"-0w@w+2d"),"%m/%d/%Y") 
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@nikita012 seems like this is a followup question to your previous question. https://answers.splunk.com/answers/738645/convert-week-number-to-the-1st-date-in-that-week.html

You can use the following snap-to setting to set to Tuesday "-0w@w+2d". Also if your previous question is resolved kindly accept/upvote that as well.

| eval WeekStartDate=strftime(relative_time(strptime(MinTime,"%m/%d/%Y"),"-0w@w+2d"),"%m/%d/%Y") 
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...