I have a log file that I pull data to a private web page to monitor my router. There are alot of entries. for each access control list. right now I have a simple php script. I only want the last 12 entries of the grep iWiSP-In. There could be 100's of them in the file. using Tail -n XX in place of cat won't work since there may not be any entries in that time frame. There has to be simple answer that is escaping me.
<?php $output = shell_exec('cat /var/log/_gateway-syslog.log | grep iWiSP-In'); echo "<pre>$output</pre>"; ?>