Splunk Search

Splunk Search: index all weekends

angelo82
Explorer

Good Morning I'm looking for collect in Splunk Search all weekends logs

i've done this one:

'sourcetype="WinEventLog:Security" earliest=@w6 latest=@w1`

and it's good only for last weekend

what should i do to collect this time range for all weekends?

i'm using Splunk 4.3.3

My Thanks in Advance

Tags (4)
0 Karma
1 Solution

Ayn
Legend

Extract the week day from the timestamp, then check events that match your conditions. Something like this:

... | eval date_wday=strftime(_time,"%a") | search date_wday="Sat" OR date_wday="Sun"

Note: the date_wday field is most often created automatically by Splunk, so if you're seeing that all your events already have this, you don't need to create it yourself using eval like what I did above. However there are situations when it will not be created, so make sure first that you're not encountering that problem.

View solution in original post

Ayn
Legend

Extract the week day from the timestamp, then check events that match your conditions. Something like this:

... | eval date_wday=strftime(_time,"%a") | search date_wday="Sat" OR date_wday="Sun"

Note: the date_wday field is most often created automatically by Splunk, so if you're seeing that all your events already have this, you don't need to create it yourself using eval like what I did above. However there are situations when it will not be created, so make sure first that you're not encountering that problem.

angelo82
Explorer

it runs perfetcly, your string is that i need

thank you very much
regards
Angelo

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...