Splunk Search

How to get the last hour of events but also remove any data after last hour

michael_wong
Path Finder
Deleted
Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

Set the time picker to Advanced and set the earliest/latest as needed -4h@h and @h

View solution in original post

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can control the time window of your search, e.g. if you set the earliest to be -4h@h and the latest to be @h , e.g.

earliest=-4h@h latest=@h

then you will get the previous 4 hours up to the last completed hour

 

0 Karma

michael_wong
Path Finder

Thanks for your help. But I need to use it in tstats command, and it will give error "'tstats' command: Invalid argument: 'earliest=-4h@h'"  Do you know any other way. Better it can use in time picker as well.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Set the time picker to Advanced and set the earliest/latest as needed -4h@h and @h

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...