Hi All,
I have different subsystems in my application, if one is down it will through some error message in log file. I have a collection of error messages in another file and I want to check each message against a log file.
my application is running on tomcat and log file will continuously appended by the server even there are no requests for server. My requirement is when I hit the server with a request, I want to capture the log of my request only into another file. Once the log file is created, I want to search for a particular pattern in that file. If pattern find I want to take only boolean value of search. Can some body help on this.
I tried by nullifying the log file before my request hits the server in my script, then it is truncating the all the lines before my request hits the server and adding garbage value for this. Then grep is treating that file as binary file and coming out of this. given below are the
perl stmts I used in my script. Some one please help on this.
[CODE=perl]$dest="APG.log" ;
$source="/home/work/APGlogs/APG.log";
system("cp /dev/null /home/work/APGlogs/APG.log");
copy($source, $dest)
my $ret = grep ($input[1],$dest);[/CODE]
I have different subsystems in my application, if one is down it will through some error message in log file. I have a collection of error messages in another file and I want to check each message against a log file.
my application is running on tomcat and log file will continuously appended by the server even there are no requests for server. My requirement is when I hit the server with a request, I want to capture the log of my request only into another file. Once the log file is created, I want to search for a particular pattern in that file. If pattern find I want to take only boolean value of search. Can some body help on this.
I tried by nullifying the log file before my request hits the server in my script, then it is truncating the all the lines before my request hits the server and adding garbage value for this. Then grep is treating that file as binary file and coming out of this. given below are the
perl stmts I used in my script. Some one please help on this.
[CODE=perl]$dest="APG.log" ;
$source="/home/work/APGlogs/APG.log";
system("cp /dev/null /home/work/APGlogs/APG.log");
copy($source, $dest)
my $ret = grep ($input[1],$dest);[/CODE]
Comment