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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...