Splunk Search

Sort 0 -_time

IRHM73
Motivator

Hi, I wonder whether someone could help me please.

I've inherited a search with the line sort 0 detail.ref,-_time.

From the Splunk documentation, I know that sort 1 -_time means 'return the more recent event', but could someone explain to me please what the zero means. My thought was that the line meant 'don't return the most recent event'.

Could someone possibly confirm for me please whether this assumption is correct.

Many thanks and kind regards

Chris

Tags (1)
1 Solution

chanmi2
Path Finder

sort 0 means no limit and returns all result
Please read the docs
http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Sort

If you want the oldest result, you may try

sort 1 _time

without the minus sign, it will sort in ascending order

View solution in original post

chanmi2
Path Finder

sort 0 means no limit and returns all result
Please read the docs
http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Sort

If you want the oldest result, you may try

sort 1 _time

without the minus sign, it will sort in ascending order

IRHM73
Motivator

@chanmi2 Thank you very much for taking the time to reply to my post and for the guidance.

Kind Regards

Chris

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...