This was originally posted by our pals over on the SCCM and OpsMgr Arabic blog but they did such a great job that I thought it was worth a mirror here. If you ever have the need to monitor a text or log file for new entries then this should do the trick.
=====
You may wish to monitor any new entry in a log/text file and want to get an alert generated no matter what the entry is. Usually we want an alert to be generated once a word or expression is logged, but in this post I will be shedding lights on monitoring a log file and generate an alert when any new entry is logged in the log/text file.
A new Entry was detect in the c:\log\bader.log
Logfile Directory : $Data/EventData/DataItem/LogFileDirectory$ Logfile name: $Data/EventData/DataItem/LogFileName$ String: $Data/EventData/DataItem/Params/Param[1]$
You can notice that the alert description includes the new entry which was logged in the log file.
Enjoy!
J.C. Hornbeck | System Center Knowledge Engineer