0

Hi All,

I need your valuable suggestion as how to sort the log files based on timestamp. Below is the sample log content.

string May 28 22:07:48 2015 Log data
string May 28 22:07:48 2015 Log data
string May 28 22:07:48 2015 Log data

I would like to sort based on "May 28 22:07:48 2015". It has both numeric and characters. so What is the way to achive dresired output.

Your help will be much appreciated.

Thanks,
Manju

2
Contributors
2
Replies
8
Views
2 Years
Discussion Span
Last Post by mkoliwad
0

The best way is to configure the program that creates the file to use the ISO standard date format: YYYY-MM-DDTHH:MM:SS

Then the sort command will do the job.

0

Hi cfajohnson,

Thanks for the suggestion, Could you let me know if this is fine.YYYY-MM-DDTHH:MM:SS ==> 2015-06-01 10:20:30

Thanks,
Manju

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.