PHP Code:
#!/usr/bin/perl
while (1) {
open LOG, 'access_log' || die "no can open file: $!";
seek(LOG,0,2);
for(;;) {
headerloop: while(<LOG>)
{
chomp;
if (/.*(texttofilter).*/)
{
open YOURLOG, '>> /home/me/outputfile' || die "can not write to file";
print YOURLOG "$_","\n";
}
}
sleep(1);
seek(LOG,0,1);
close YOURLOG;
}
}
Thanks
The grep option works without sending to file AND sending to file works without the grep there. It seems that soemthing is messed up.