File monitor

File monitor

Hi
I'm wondering how can i create a monitor which can follow the increase in percentage of a string in a file and after a previously configured  value of that increase  to generate an alarm. For example i want to count the occurrence of the word "Test" in the file cdr.log and if those occurrences increase given value to generate the alarm.

Thank you in advance.