I am looking for some basic script help, I am currently tailing a log with a simple
tail �f, combined with egrep �vi to remove some messages from the tail, i do not want to see.
.
I wanted to create something a little more complex were if it�s possible to script this into something that if a specific word comes up in the tail it will do an action but continue the tail of the log... any ideas?
What I think ltomuno is implying, but fails to mention, is that instead of printing the record that matches the pattern, you could execute a script that might, say, send an email or something. Taking the previous example a bit further this executes an alert script that deals with the observed record:
Hmm intereting, I just tried replacing some values (no added script to execute and it does not appear to work, I am getting no chatty being tailed from the log, and trust me I have plenty.
Maybe I am miss understanding the string, I am fairly new.
alert_script = email.pl script (if I had one)
were would I place the trigger words such as crit ect..? to launch the script?
I just reread your original post, and realised that the example offered by ltomuno, which I expanded on, was matching the string(s) you were wanting to exclude. So, assuming that you want to match the strings "CRIT" or "WARN" then and drive your alert script with what triggered it as the first parameter you could use something like this: