bash - Script that monitors log file quits unexpectedly -


i've written simple script monitors elasticsearch.log looking specific pattern , sending curl post request.

#!/bin/bash  tail -f -n 0 elasticsearch.log | \ while read -r line     echo "$line" | grep '<pattern>'   if [[ "$?" -eq 0 ]]        curl -x post <url>   fi done 

the problem script quits unexpectedly 0 exit status. have idea might reason?


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -