Splunk Search

How to change a span of 1 week time to start from Monday to friday

syedabuthahir
Explorer
How to change a span of 1 week time to start from Monday to friday
 
usually span=1w it will show data from monday 00:00 hrs to Sunday 23.59 hrs
 
Can someone help on this query 
 
Thanks in Advance
Labels (1)
Tags (1)
0 Karma

syedabuthahir
Explorer

@yuanliu  can i have the search query

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

This is an example. My data comes in once a week on Sunday.  But sometimes it comes late by a day or two.  I want to plot data by week:

| eval _time = _time + 5 * 86400
| timechart span=1w@w count

 Here, positive or negative offset is chosen based on how I want to date label to show on the time axis.

0 Karma

aasabatini
Motivator

Hi @syedabuthahir  

try this:

 sourcetype=foo
| eval date_hour=strftime(_time, "%H") | eval date_wday = strftime(_time, "%w")
| search date_hour>=0 date_hour<=23 date_wday>=1 date_wday<=5
“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”
0 Karma

yuanliu
SplunkTrust
SplunkTrust

When I need to fudge week, I add or subtract days from _time.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...