Splunk Search

sorting date

srajanbabu
Explorer

I have a query as source="C:\Data\acctdata\snm4-logger.log" "Customer has successfully retrieved file"| rex "::\s(?\S+)\s"| rex "^\S+\s(?\S+)." | rex "\s(?\S+)\s((?\d+)\srecords/(?\d+)\sbytes)$"| stats count sum(record_count) as RecordCount sum(byte_count) as ByteCount by timestamp userid .I want to sort the timestamp in descending order
so that result would be

userid RecordCount ByteCount timestamp

AAMG1FBY 3105 1586745 05/03/13
AAMG1SBY 3129 1597053 04/03/13

Tags (1)
0 Karma

Ayn
Legend

Uh well, sort? http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sort

source="C:\\Data\\acctdata\\snm4-logger.log" "Customer has successfully retrieved file"| rex "::\s(?<timestamp>\S+)\s"| rex "^\S+\s(?<userid>\S+)\." | rex "\s(?<file_name>\S+)\s\((?<record_count>\d+)\srecords/(?<byte_count>\d+)\sbytes\)$"| stats count  sum(record_count) as RecordCount sum(byte_count) as ByteCount by timestamp userid | sort - timestamp
0 Karma

polymorphic
Communicator

You should be able to do:
| sort -timestamp

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...