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 Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...