i have a question about executing a command if a certain text is in a log file. There is already the article: https://unix.stackexchange.com/questions/12075/best-way-to-follow-a-log-and-execute-a-command-when-some-text-appears-in -the-log. So my question is: is it possible to do one thing for one contained text and something else for another text?
my current code is:
tail -F ~/server/logs/current.log | grep --line-buffered " was stopped. Please stop to prevent Server crashes" | while read; do killall java; done
kind regards,
Tuti Bird