Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

monitor log file for string

tail -fn0 logfile | 
while read line ; do
        echo "$line" | grep "pattern"
        if [ $? = 0 ]
        then
                ... do something ...
        fi
done
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #monitor #log #file #string
ADD COMMENT
Topic
Name
5+1 =