I'm trying to do a bash script, but i'm not really going good..
I have a log file that has a lot of these with different job ids:
theserver.log:2011-09-29 10:06:26,210 INFO [Class] Registering the start of job thejobName of group thejobGroup[jobId=2d1bb3dfe2d4f2a954f574e6f8855004]
theserver.log:2011-09-29 17:52:15,235 INFO [Class] Registering the finish of job thejobName of group thejobGroup[jobId=2d1bb3dfe2d4f2a954f574e6f8855004] : SUCCESS
I'm doing this to separate all log lines by jobs.. my intention is to change the grep line to generate some other output, something like "DATE TIME - Finish|start - SUCCESS|FAIL" for each job, but i'm currently getting a weird result, it's like the grep works only for the first job, i think perhaps the $job is not being renewed in each loop.
while read inputLine
job=`sed 's/^.*jobId=//' | cut -d ']' -f1`;
echo "grep result for $job:\n"$
grep -i $job $logFile$
done < $logFile
thanks in advanced!