Issue
My logs are not ordered by date :
1. 2013-09-13T09:44:10.581-0400 - [email protected] - (v1.6.88) - REPLAY >> Scheduling replay in 2 seconds
2. 2013-09-13T09:44:10.546-0400 - [email protected] - (v1.6.88) - REPLAY >> Delay of 106803.116188 seconds
3. 2013-09-13T09:44:10.581-0400 - [email protected] - (v1.6.88) - REPLAY >> Hexoskin - replay completed 2013-09-13T09:44:10.535-0400 - [email protected] - (v1.6.88) - Hexoskin SDK - Playback ended with 0x0000
How can I order them ?
I looked at the command line sort but I was not able to sort by date iso8601.
Solution
You want to sort by the second field (2013-09-13...), not the whole line. You can specify that using the -k parameter:
sort -k 2 log.txt
Answered By - kielni Answer Checked By - Candace Johnson (WPSolving Volunteer)