I have big large snapshot file which contains every process start time and end time. One server snapshot contains many Application handle. My task is to identify the process id for which the end time is not there or empty also if the completion time is not on the same date then I need to kill.
The process is noted in the log file like “Application handle = 189” and the 14th and 15th line contains the time stamp like
I think I need to separate the file in pieces by the searching the string Application handle, then using awk take the start time and compared to end time.
There might be several ways of doing this, probably by simply counting lines and predicting where the "Connection request*" and "Process ID*" lines are.
My logic for this solution is storing every line into an $app var and when I find /Application Snapshot/ and I'm not on the first line or it's the EOF (END {}), I process $app which contains all the lines referring to the "last" application entry. So after processing I could choose to print $app or not ...
In print "$1 $2\n"; $app = ""; It could have something like if ($1 something and $2 something) { print $app; } $app = "";
Thus only printing $app if the requirement fits the need.
I am obviously new to Unix Script writing, and I think I am trying to do this in SQL when im not in a SQL environment. What I need to do is the following
EXTRACT_ROW_COUNT=`grep Number $REFERENCE_LOG"extract_concern.log" | sed '/Number of rows exported:/s/.*:*\(*\)$/\1/'`
LOADED_ROW_COUNT=`db2... (7 Replies)