I am trying to list out all the files in a UNIX folder in Geneos that contains yesterday's date. I tried using the FKM & FTM plugin but it lists out only the 1st file it detects if i give a wildcard character. Ex: /location/*
How to configure Geneos so that it lists out all the file in a folder in UNIX server containing certain fixed character?
You need to use two concepts in the FKM plugin: Date Generation & Dynamic Files.
Included below are exerpts from the really useful help guides and an example xml if you want to copy and paste it into the editor.
Date Generation
FKM file definitions can be configured to generate a filename using the current date and time. The target filename is generated every sample, and if a file exists which matches this name the file will be monitored by FKM (once the current file has been processed to the end). Filenames can be generated using one of three date codes; yesterday, today or tomorrow. These are replaced in the filename using the appropriate date. For example, if the current date is 22-Aug-2008 the following will be produced:
The output format for dates can be controlled by placing format codes in the date tag. Examples of this usage are shown below.
The following formatting codes can be used with this feature.
Note It is possible but not recommended to use a seconds (%S) or minutes (%M) time format code in a filename. This is because the generated filename will contain the time at which FKM performed a sample, which is not guaranteed to occur at an exact number of seconds apart.
Dynamic Files
files > file > source > dynamicFiles
The dynamicFiles type file-source configures FKM to match groups of files based the configured path, pattern and optionally the alias.
When a new group is identified, an additional file row is created which behaves as a normal filename source. Settings for this new row are copied from the settings of the parent dynamicFiles row. The row will be removed when no files remain to create that grouping.
This feature is similar to using a normal filename source with the wildcardMonitorAllMatches setting, but the two features cannot be used in conjunction. FKM will report an error if you attempt to do this.
Groups are specified using the path setting, which should be a file path containing wildcard globbing characters (* and ?). This path will be evaluated, and all files discovered will then be matched against the configured regex pattern.
The name of a row in the view is determined by evaluating the file alias. Any numbered inserts in the alias (identified by a % followed by a number, e.g. %4) will be replaced with the content of that capture group in the regex pattern, as matched against the filename. Capture groups that do not exist or have no content will be replaced with an empty string. A literal percent character can be produced escaping it as %%. When using a case-insensitive regular expression, insertions will be lowercased to ensure consistent row names.
For example, the value of capture group 1 for regex "app_(.)_\d+.log$" matched against file "app_Apache_001.log" would be "Apache" (the contents of the . portion of the regex). The website http://www.internetofficer.com/seo-tool/regex-tester/ can be used to test regexes against various strings, to see the content of each capture group.
Given the following configuration:
And the files:
FKM would create two rows in the view:
The file app_Apache_002.log is selected over app_Apache_001.log because it has a more recent modification-time (it is assumed that Apache is rolling files by creating higher-numbered logs). The time used for this check can be controlled using the wildcardMatchTime setting. File "app_Router.log" is ignored as it does not pass the regex.
Example XML
Reference
ITRS Resource Link