Hi All
I have a file which contains the timestamp of the log and a message and I want to implement a polling mechanism, where this log file is pooled every 2 minutes and list the errors in the file. I want to list down the errors only after the timestamp in the file is more than the current timestamp.
Example :-
File <randomcheck.log>
2018-07-16 10:56:21,174 [info - we are in the team]
2018-07-16 10:56:21,181 [Error - we are not in the team - access denied]
2018-07-16 11:01:18,522 [info - we are in the team]
2018-07-16 11:01:19,522 [info - we are in the team]
2018-07-16 11:01:20,548 [info - we are in the team]
2018-07-16 11:01:21,548 [info - we are in the team]
2018-07-16 11:01:22,548 [Error - we are not in the team - access denied]
2018-07-16 11:01:23,548 [info - we are in the team]
2018-07-16 11:01:23,548 [info - we are in the team]
2018-07-16 11:01:23,549 [info - we are in the team]
Lets say, I execute the check job at 2018-07-16 11:00:00
Expected output :-
2018-07-16 11:01:22,548 [Error - we are not in the team - access denied]
I do not want to have any earlier message displayed.
Can not use grep as the logs are random, they are not written every second/ minute so can not create a pattern.
Appreciate your help on this.