This template searches for a regular expression pattern in the last modified file of a specified folder and returns the matches with positions if the specified pattern is found, 0 if not found. The last modified file is filtered by the filename substring. This is helpful for log files that keep rotating and when there is a need to search in the latest log file.
Prerequisites: WMI access to the target server.
Credentials: Windows Administrator on the target server.
Note: Tested on Windows Server 2008 R2
This component looks through all the files in a folder, filters for files based on the substring specified and finds the last modified file. It then tries to search for the specified pattern in this file. If the search pattern is found it returns the matches with positions, returns value of 0 if the pattern is not found.
Arguments: Folder to scan, filename pattern, regular expression search pattern
The template has been modified to include global searches and to show the string that matches the pattern search.
Tip: To view the lines with the search pattern, specify the search pattern as ".*pattern.*"