The problem is the if [[...]] expression, where you use 2 grep commands without using the command substitution ie $(grep 'pattern' file) .
However, instead of:
if [[ grep $check_val1 $log -ne $check_val1 || grep $check_val2 $log -ne $check_val2 ]]; then
You can use grep -q :
if grep -q -e "$check_val1" -e "$check_val2" "$log"; then
According to man grep :
-q,
anubhava
source share