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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...