We need to monitor a dynamically or randomly named file for a specific log entry or message. The issue we are running into is the dynamic name. Instead of a name like application_message.txt, it is application_message_#####.txt where the number represents the PID of the service each time it is restarted. We need a way to interrogate a dynamically named logfile.
We recommend using wildcards in the file path for a dynamically changing file name. For example, C:\path\to\file\application_message_*.txt
Note that you may not be able to use logmon to 'Browse' the file due to the wildcard.
If you manually change the file name/PID in the folder each time you want to test it, it should work during a normal run and generate your desired alarm, etc. You can check the logmon.log during the test run.
Use 'cat' mode to test the logmon profile and then 'updates' when letting the logmon profile run on its interval.
To test it out, change the random PID in the filename extension application_message_#####, each time you want to test the results.
Enter a /string/ for the match expression inside the logfile to parse - when testing it doesn't matter what you include in the logfile to test it as you just want to be able to monitor the changing file name and successfully parse the logfile contents.