June 9, 2017

Shell script prog takes a log file as input. The log file contains the log statements with message stamp as shown below. The utility lists out all the actions that took more than the 2 seconds.

#<process id> <date time> <log level> <file name> <line number> <actual message>

1098 2007-02-28 15:23:09 WARN db_util.c 5928 Config file not found, using default values
1098 2007-02-28 15:23:09 INFO db_util.c 5908 Connecting to database
1098 2007-02-28 15:23:17 INFO db_util.c 5908 Connected to database
1098 2007-02-28 15:23:17 ERROR log_test.c 198 Unable to setup our satellite launch system
1098 2007-02-28 15:23:18 INFO log_test.c 198 Reconnecting to launch the satellite
1098 2007-02-28 15:23:21 INFO log_test.c 198 Reconnected. Initialize to launch the satellite.

Click Here!