Hey Friends,
All the system Admin for any application supported by Unix / Linux may face this common issue multiple times, when he has to look for the root cause for any issue encountered. We know the log file helps alot in identifying the root cause of any issue, but we know its not that easy, even if you filter or grep with some special character strings. But the best part is, that log files are generated with respect to timestamp (as in my case its yyyy-mm-dd HH:MM:SS format eg. for 1-Oct-2016 00 hours it will be as: 2016-10-01 00:00:00)
There may also be requirement when you need to get all data for certain period of file.
Now let us focus on what commands can help us on such requirements based on case:
Case-1 - A User needs issue.out file data from 1st October to 5 October
Solution -
You need to execute command to filter required data & then redirect that data to other file
Command-
All the system Admin for any application supported by Unix / Linux may face this common issue multiple times, when he has to look for the root cause for any issue encountered. We know the log file helps alot in identifying the root cause of any issue, but we know its not that easy, even if you filter or grep with some special character strings. But the best part is, that log files are generated with respect to timestamp (as in my case its yyyy-mm-dd HH:MM:SS format eg. for 1-Oct-2016 00 hours it will be as: 2016-10-01 00:00:00)
There may also be requirement when you need to get all data for certain period of file.
Now let us focus on what commands can help us on such requirements based on case:
Case-1 - A User needs issue.out file data from 1st October to 5 October
Solution -
You need to execute command to filter required data & then redirect that data to other file
Command-
| grep "2016-10-0[1-5]" issue.out >
required_data.out Case-2 - A User needs something.log file but only for error data of 1st October -2016 from 10 am to 11 am server time Solution - You need to execute command to filter required data & then redirect that data to other file (required_data.out in my case) Command-
|
No comments:
Post a Comment