I've got the log file for a program; the log records every task done by the software. I've modified the software to insert a line such as "operations terminated"
into the log when the software is done executing. I am trying to write a script in Groovy that looks for this "operations terminated"
line in the log file. I am unsure how to proceed because the log file changes with time and I want to catch "operations terminated"
as soon as it pops up. I don't know how to put in a recursive or continuous check... Suggestions? Thanks!
Asked
Active
Viewed 1,072 times
1

Michael Easter
- 23,733
- 7
- 76
- 107

blaughli
- 517
- 5
- 11
- 27
-
2Here is a Q/A on tailing a file in Groovy. Checking the lines for a specific pattern is an easy extension: http://stackoverflow.com/questions/7905605/tail-a-file-in-groovy – Michael Easter Dec 20 '11 at 23:57
1 Answers
0
monitoring may be a solution
https://stackoverflow.com/a/495962/722948
So then. you could take the delta of the file and search for a specific line/word