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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...