Quote:
Originally Posted by
svajhala
Thank you. I am working on bourne shell.
Sorry I am a rookie here. As soon as the value (from the last line of the file) matches the search string, I want to send an email and continue to monitor the log for the next message.
Example:
Search String = AWX_38900
file name=service.log
I want to search for the string 'AWX_38900' in the last line of the file service.log and if it finds a match, it has to send an email to the group of people and continue monitoring the service.log for the next message.
Someone with over 100 posts who has been in the forums for more than seven years doesn't really count as a rookie...
Great. So, take the code I suggested for doing what you're trying to do, replace the
echo command with a command to invoke your mail sending utility (with an appropriate subject line, destination address, and a message body including the line you captured.
You still haven't told us what operating system you're using so there's no way we can guess at what mail sending utilities might be available to you. But with over 100 posts to your credit, you should be able to come close to solving any remaining issues on your own. See what you can do and show us where you get stuck if you can't get it to work.