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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...