1

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!

Michael Easter
  • 23,733
  • 7
  • 76
  • 107
blaughli
  • 517
  • 5
  • 11
  • 27
  • 2
    Here 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 Answers1

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

Community
  • 1
  • 1
hgoz
  • 641
  • 6
  • 18