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!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

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

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...