The "Log File Scraper" custom step makes it possible to extract ERRORS and WARNINGS from one or more SAS log files and makes them available in a table. Finding the ERRORS and/or WARNINGS is done using a regular expression.
In a situation where your process generates physical log files, you can extract the generated ERRORS and WARNINGS and make them available for further processing.
Here you need to select the following:
- Select the SAS Compute file directory where the log files can be found: This needs to be the directory where the log files are written and/or downloaded to. Note that the custom step doesn't process subfolders and that the directory can't be a SAS Viya content directory.
- 'Today' minus number of days: With this value you can specify a date range for the log files you want to include in the scraping process. In this example, this custom step processes the log files for the last 7 days. The default value is 0, meaning it will only scrape log files generated today.
Download the step, upload it into your environment drag it on the canvas of your flow, specify the directory your log files are located and specify the date range and run the custom step.
Running the custom step results in a table containing the WARNINGS and/or ERRORS found in the log files for the give date range.
The table contains the following columns:
- logfile: The name of the logfile contains the ERROR(s) and/or WARNING(s).
- file_dt: The date the log file is created or downloaded.
- file_tm: The time the log file got created or downloaded.
- path: The location of the logfile
- text: The actual warning- or error message.
- linenum: The line number the warning or error is found at.
-
Version 1.1 (08NOV2024)
- Published externally
-
Version 1.0 (11DEC2023)
- Initial version