php - how to execute a mysql query each time tail -f shows up a new line from a log file in linux -


i'm trying monitor log file tail -f , parse extract data grep , pass data mysql query. passing each new line detected tailf php script, don't know how that.. or simulate tailf php directly, how monitor file changes php? think having while , size , remember last position, seek , read till difference right? can give hints on what's better use? or simpler? i've heard named pipes solution don't know how grab data there logger nginx way.. thank you

in shell can like:

tail -f file.log|grep whatever-you-want|while read line;    echo $line done 

just change line echo $line want - can call php or whatever want in line, $line the line tail/grep combination.

take @ these soq more info:


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -