Splunk Search

is their way alert(search query) can distinguish between weekdays, weekends, monthend?

rsathish47
Contributor

hi All,

is their way alert(search query) can distinguish between weekdays, weekends, monthend?

Thanks
Sathish R

Tags (1)
0 Karma

woodcock
Esteemed Legend

Like this:

... | eval now=now() | eval date_wday=strftime(now, "%a") | eval weekday=if(date_wday="Sat" OR date_wday="Sun","NO","YES") | eval  date_mday=strftime(now, "%d") | eval tomorrow=now+86400 | date_mday_tomorrow=strftime(tomorrow, "%d") | eval monthend = if(date_mday>date_mdate_tomorrow,"YES","NO") | fields weekday monthend
0 Karma
Get Updates on the Splunk Community!

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 ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

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 ...