I have a log file monitor script that checks through a log file for a string. I use awk to search the log file, starting at the last checked line, for the specified string and then output the count and the last row number checked. The part of the script that does all the work is here:
This particular log is a java app server log and we're looking for the occurance of "Full GC". Now, they want to only count the Full GC if the amount of recovered space is less than 100000. This is what the total output of a Full GC looks like in the log:
I have bolded the 2 numbers I need to calculate. If the first number minus the second number is less than 100000 then I want to advance the count.
I'm stuck. I've created a mock log and messed around a bit and only came up with this:
I can figure out how to get that into my set command above and get it to output the count. I can't figure out how I'll output the last line number of the log that was checked. I'm hoping someone can take the time to show me how to do this properly.
Dear All,
I want to compare column 3 and column 4 of files(File1 and File2) and want to get the matched records in one file and rejected records in another file.I have tried an awk script,but as Iam not good in it,I cant able to continue.Can anyone help me in this one.
File 1... (0 Replies)
I am trying to write a script that will parse out the e-mail address of a person from the name of a file in a directory.
Example:
filename is:
/home/myname/first.middle.last@email.com.xls
I want to extract just the email address and mail the file to that address.
I want to send the... (6 Replies)
How do I alter this command so that it prints only the second comma delimited field from line number 3? Secondly, how do you redirect the output to a variable called TEST?
Thanks
(cat BATCH007.TXT | awk 'BEGIN { FS = "," } ; {print $2 }') (5 Replies)
Hi ,
i have a file a.txt like this:
far
near
veryfar
toonear
typeset var1=veryfar
to extract the text between two strings i use the following command :
awk '/far/,$veryfar/' a.txt
its not working
can nyone tell pls whats wrong in it ?
i doubt can we use variable in awk like this... (3 Replies)
hi,
I have input file woth records as shown below
OCSMRC_OK,7057348733,+0.00,0,18/05/2010 23:42:19,BellMobility,302610000918553,0006056099,B30,686505,686505,OCS_MRC,+49.14,0,0
,0,0,
OCSPPKB_NOK,4163460120,+1.25,0,18/05/2010... (4 Replies)
Dear all,
I am new to use unix. I run the following command and got the error. Anyone knows how should I modify the command. Thanks a lot!
$
for chr in 'seq 1 23';
do
awk 'BEGIN {print "T","pheno";}{print "M",$2}' out_${chr}.map > dat_${chr}.dat;
done
error message:... (2 Replies)
Hi Experts,
I have a file (file 1) with several columns and I need to create 2 files based on the data of 20th column of file 1.
Criteria 1 : If the 20th field of file1 is empty , copy the entire records to file 2.
I am successfully able to do this with the following awk code :
awk... (2 Replies)