Script for parsing a log file
hi,
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: Code:
theserver.log:2011-09-29 10:06:26,210 INFO [Class] Registering the start of job thejobName of group thejobGroup[jobId=2d1bb3dfe2d4f2a954f574e6f8855004] 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. Code:
while read inputLine |
Hi,
The line you read is stored in inputLine, which you do not use in the loop itself. Hope this gets you going again. |
May I also suggest you consider what will be stored in $job prior to running grep??
|
Also see this page for some hints on doing various string manipulations in-shell. You can probably avoid having to run the external sed and cut processes.
http://mywiki.wooledge.org/BashFAQ/100 |
All times are GMT -5. The time now is 06:54 AM. |