www.tutorialspoint.com Open in urlscan Pro
192.229.221.69  Public Scan

Submitted URL: https://www.tutorialspoint.com/splunk/splunk_sort_command.htm#:~:text=The%20sort%20command%20sorts%20all,is%20descending%20or%2...
Effective URL: https://www.tutorialspoint.com/splunk/splunk_sort_command.htm
Submission: On March 16 via manual from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

×


Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Tutorix
Login

Categories
 * * Academic Tutorials
   * Big Data & Analytics
   * Computer Programming
   * Computer Science
   * Databases
   * DevOps
   * Digital Marketing
   * Engineering Tutorials
   * Exams Syllabus
   * Famous Monuments
   * GATE Exams Tutorials
   * Latest Technologies
   * Machine Learning
   * Mainframe Development
   * Management Tutorials
   * Mathematics Tutorials
   * Microsoft Technologies
   * Misc tutorials
   * Mobile Development
   * Java Technologies
   * Python Technologies
   * SAP Tutorials
   * Programming Scripts
   * Selected Reading
   * Software Quality
   * Soft Skills
   * Telecom Tutorials
   * UPSC IAS Exams
   * Web Development
   * Sports Tutorials
   * XML Technologies
   * Multi-Language
   * Interview Questions


Q/A
Library
eBooks
Courses
 * Splunk Tutorial
 * Splunk - Home
 * Splunk - Overview
 * Splunk - Environment
 * Splunk - Interfaces
 * Splunk - Data Ingestion
 * Splunk - Source Types
 * Splunk - Basic Searching
 * Splunk - Field Searching
 * Splunk - Time Range Search
 * Splunk - Sharing and Exporting
 * Splunk - Search Language
 * Splunk - Search Optimization
 * Splunk - Transforming commands
 * Splunk - Reports
 * Splunk - Dashboards
 * Splunk - Pivot & Datasets
 * Splunk - Lookups
 * Splunk - Schedules and Alerts
 * Splunk - Knowledge Management
 * Splunk - Subseraching
 * Splunk - Search Macros
 * Splunk - Event Types
 * Splunk - Basic Chart
 * Splunk - Overlay chart
 * Splunk - Sparklines
 * Splunk - Managing Indexes
 * Splunk - Calculated Fields
 * Splunk - Tags
 * Splunk - Apps
 * Splunk - Removing Data
 * Splunk - Custom Chart
 * Splunk - Monitoring Files
 * Splunk - Sort Command
 * Splunk - Top Command
 * Splunk - Stats Command
 * Splunk Useful Resources
 * Splunk - Quick Guide
 * Splunk - Useful Resources
 * Splunk - Discussion

 * Selected Reading
 * UPSC IAS Exams Notes
 * Developer's Best Practices
 * Questions and Answers
 * Effective Resume Writing
 * HR Interview Questions
 * Computer Glossary
 * Who is Who




SPLUNK - SORT COMMAND

--------------------------------------------------------------------------------

Advertisements


Previous Page
Next Page  


The sort command sorts all the results by specified fields. The missing fields
are treated as having the smallest or largest possible value of that field if
the order is descending or ascending, respectively. If the first argument to the
sort command is a number, then at most that many results are returned, in order.
If no number is specified, the default limit of 10000 is used. If the number 0
is specified, all of the results are returned.


SORTING BY FIELD TYPES

We can assign specific data type for the fields being searched. The existing
data type in the Splunk dataset may be different than the data type we enforce
in the search query. In the below example, we sort the status field as numeric
in ascending order. Also, the field named url is searched as a string and the
negative sign indicates descending order of sorting.


SORTING UP TO A LIMIT

We can also specify the number of results that will be sorted instead of the
entire search result. The below search result shows the sorting of only 50
events with status as ascending and url as descending.


USING REVERSE

We can toggle the result of an entire search query by using the reverse clause.
It is useful to use the existing query without altering and reversing the sort
result as and when needed.



Previous Page Print Page
Next Page  

Advertisements


 * Print
 *  Add Notes
 *  Bookmark this page
 *  Report Error
 *  Suggestions





Save Close



Dashboard
Logout


 * About us
 * Refund Policy
 * Terms of use
 * Privacy Policy
 * FAQ's
 * Contact

© Copyright 2021. All Rights Reserved.

We make use of cookies to improve our user experience. By using this website,
you agree with our Cookies Policy. Agree Learn more