Splunk Search

How to specify earliest and latest time modifiers to display previous week and current week results?

sxp5686
Explorer

Hi,
We are having option of previous week and current week in time modifier in search.Can anyone tell how I will get the equivalent code, in terms of earliest and latest.

Tags (1)
0 Karma
1 Solution

mayurr98
Super Champion

hey
for previous week:

earliest=-7d@w0 latest=@w0

for current week:

earliest=@w0 latest=now

let me know if this helps you!

View solution in original post

mayurr98
Super Champion

hey
for previous week:

earliest=-7d@w0 latest=@w0

for current week:

earliest=@w0 latest=now

let me know if this helps you!

sxp5686
Explorer

We can try this also.

For earliest :
earliest=-1w@w latest=@w

For latest:
earliest=@w latest=now

0 Karma
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf24, and Community Connections

Thank you to everyone in the Splunk Community who joined us for .conf24 – starting with Splunk University and ...

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

 (view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...