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
Post a Comment