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!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...