Shell script- need help

Hi below is my current scripting which will monitor for any errors in the application

logfile="/tmp/application.log"
output=$(grep "ERROR" $logfile)
if [ -n "$output" ]
then
echo "found- send email"
else
echo "not found"
fi

Now I wanted the script NOT TO MONITOR for one of the occurence of the error which is a known issue
Could you please help me as how can I set this up
The error string I wanted to EXCLUDE from monitoring is below

" ERROR - Error while reading from socket
java.net.SocketException: Connection reset "

just change

output=$(grep "ERROR" $logfile|grep -v "pattern that u don't want to match")

man grep:

-v, --invert-match
Invert the sense of matching, to select non-matching lines. (-v
is specified by POSIX.)

2 Likes

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.