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!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...