Splunk Search

Comparing last year to this year

JovanMilosevic
Path Finder

Hi,

I have 3 single values displaying YTD, MTD and Today's figures.

What I'd like to do is have another 3 single values that give last year's equivalent figures, i.e.

Jan 1 to Sept 17 2011 inclusive, Sept 1 to Sept 17 2011 inclusive, and Sept 17 2011.

Just can't seem to work out what time modifiers I should use.

Thanks in advance.

Tags (1)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi JovanMilosevic

try the following time setting after your search string:

Jan 1 to Sept 17 2011 inclusive -> earliest=-y@y latest=-y@+d@d

Sept 1 to Sept 17 2011 inclusive -> earliest=-y@mon latest=-y@+d@d

Sept 17 2011 -> earliest=-y@d@d latest=-y@+d@d

cheers,

MuS

View solution in original post

MuS
SplunkTrust
SplunkTrust

Hi JovanMilosevic

try the following time setting after your search string:

Jan 1 to Sept 17 2011 inclusive -> earliest=-y@y latest=-y@+d@d

Sept 1 to Sept 17 2011 inclusive -> earliest=-y@mon latest=-y@+d@d

Sept 17 2011 -> earliest=-y@d@d latest=-y@+d@d

cheers,

MuS

MuS
SplunkTrust
SplunkTrust

yes, the last @d snaps to the current day, without it it uses the actual time. you can test it in the manager by clicking the timepicker and use the advanced search language. the docs about the time range are here http://docs.splunk.com/Documentation/Splunk/4.3.4/User/ChangeTheTimeRangeOfYourSearch

0 Karma

JovanMilosevic
Path Finder

Thanks for this. For the Sep 17 search, is it possible to get the search to retrieve records for up to the current time on that day, rather than the whole day ?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...