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

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -