Splunk Search

What would be the syntax for the Earliest time modifier to report on data for the last 12 months?

Vijaikanth
Path Finder

Requirement is i need to fetch a Report for the last 12 months.

If today's date is Jun 23, 2015 10:12:20 AM then my

Latest Event = NOW,
Earliest Event = July 1, 2014 00:00:00 AM

What will be the expression i need to use to get that Earliest event?

If i specify "-y" or "-1y@month" it will give June 1, 2014 as Earliest event so usually i get 13 months in the result set (Starting from June 2014 to June 2015 - count 13 months) but any time if the report runs it should give 12 months data in column

0 Karma
1 Solution

srinathd
Contributor

Try earliest=-11mon@mon latest=@d

View solution in original post

0 Karma

srinathd
Contributor

Try earliest=-11mon@mon latest=@d

0 Karma

Vijaikanth
Path Finder

Thanks Srinath. In case if the date is "July 1, 2015" then according to the above answer

earliest = -11mon ==> earliest = "Aug 1, 2014" .

so it will return 11 months right.. or it will return from "July 1, 2014" to "July 1, 2015" ?

0 Karma

srinathd
Contributor

Then use earliest=-12mon@mon latest=@mon or @d based on your need.

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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...