I feel like this should be a simple thing but I am having a hard time figuring it out.
I am trying to write a script that will monitor one of the apache log files and take some specific action. But how should I go about monitoring the log file?
Everytime a new line is written to log, I want that entry to be checked to see if it matches what I am looking for and if so x happens. When I am doing this manually I used cat or tail -f. I dont want to run the script every 30 seconds via cron and go through the whole log (or even the last 5 lines), figure out which of those lines are new since the last time the script ran and then so some things.
Is there a way only check the single new entry in the log?