I have a question, just for curiosity reasons, is there any drawbacks of monitoring server and a text file (e.g Apache log file) using tail and pipe to output the lines to perl script? I want to do it like this so i can control the formatting with the Perl script as i want it to be.
tail -f -n 0 /etc/httpd/logs/access_log | ./readStdin.plSo the above command is what i run from my Linux www server, the tail command stays real-time in reading the access_log and since that readStdin.pl script is taking input using while (<STDIN>), it waits "indefinitely" for new lines to be formatted and displayed.
I'm just curious if there is some major problem with this kind of monitoring that i haven't even thought about.
Please, comment freely.
In reply to Using pipe and reading from the stdin by mellin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |