How to send email based on log file entry

0

On HP-UX, I'm looking for a way to have tail running and immediately send an email if is encountered. Something like:

tail -f mylog | grep "ERROR" | send email

Trying to avoid cron job, as the interval between last and next run may not catch the string I wanted to see immediately.

Any thoughts?

TIA!

user2585040

Posted 2019-05-17T18:54:52.233

Reputation: 1

No answers