The FKM setup would be as follows:
Select the “dynamicFiles” drop-down option under Source.
Click the “Dynamic files…” button which opens the Dynamic files window as seen below:
In the Path field, put the complete file path and use the today function followed by *.log.
This allows the FKM sampler to automatically monitor files in the folder with today’s date on it.
In the Regex field put the following Regex expression:
For the FKM sampler to grab the latest version of each file in the directory, the regex expression needs to be unique.
We do that by including the Logs\/ sub-folder in the regex expression since the Logs sub-folder will remain the same.
Followed by the pattern for the date folder:
We have a capture group (.*) in the expression that will hold a portion of the filename up until the dash (-) number portion dot (.) log. The capture group is used in the name column of the dataview.
The following -\d+ ensures we consider the last dash in the filename followed by the number.
The .log at the end will apply only to files with that file extension.
Below is the Metrics view of the FKM sampler displaying Prod_ProcessA-13.log, Prod_ProcessB-13.log, and Prod_ProcessC-13.log files.
Attached is the "FKM - dynamic example" sampler. Please note this sampler was set up on version GA5.9.0.