Splunk® Cloud Services

SPL2 Search Manual

SPL2 commands that sort results

When you run a search that returns events, by default the events are returned in descending timestamp order, with the most current events returned first.

There are some SPL2 commands that sort the search results automatically. These command have some sort of BY clause:

  • FROM GROUP BY clause
  • FROM ORDER BY clause
  • sort <sort-by-clause>
  • stats <by-clause>
  • streamstats <by-clause>
  • timechart <split-by-clause>

The field that you specify in the by-clause is the field on which the results are sorted.

See also

Related information
Lexicographical order
Last modified on 16 October, 2023

This documentation applies to the following versions of Splunk® Cloud Services: current

Was this topic useful?

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters