Splunk Search

set earliest and latest time stamp

k_harini
Communicator

How to set earliest to 26th of previous month and latest to 25th of current month? if hard corded then 26th of Feb to 25th of March is the cycle. Please help with some examples. Thanks!

Tags (1)
0 Karma
1 Solution

muebel
SplunkTrust
SplunkTrust

Hi k_harini, Including something like this into your search should set the time interval as you want:

earliest=-1mon@mon+26d latest=@mon+25d

You might have to adjust it a bit, but the basic idea is to look at the previous month, relative to the start of this month, -1mon@mon and then add 26 days to it, +26d

Likewise, the latest time should be from the start of the current month @mon to 25 days into the month +25d

You might need to adjust the day values to get exactly what you want, but this should do the trick.

Please let me know if this answers your question! 😄

View solution in original post

k_harini
Communicator

Thanks everyone for prompt response. This forum helps a lot.

0 Karma

muebel
SplunkTrust
SplunkTrust

Hi k_harini, Including something like this into your search should set the time interval as you want:

earliest=-1mon@mon+26d latest=@mon+25d

You might have to adjust it a bit, but the basic idea is to look at the previous month, relative to the start of this month, -1mon@mon and then add 26 days to it, +26d

Likewise, the latest time should be from the start of the current month @mon to 25 days into the month +25d

You might need to adjust the day values to get exactly what you want, but this should do the trick.

Please let me know if this answers your question! 😄

woodcock
Esteemed Legend
0 Karma

somesoni2
Revered Legend

I guess there is a typo in latest (you meant 25 and not 245).

woodcock
Esteemed Legend

HA HA, yes! Fixed now, thank you.

0 Karma
Get Updates on the Splunk Community!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...