The logmon probe supports the use of Time Formatting Primitives. The log file name, command or path can be constructed using text and special primitives for the system-call strftime.
strftime stands for "string format time," and it's a function in programming used to format date and time objects into readable strings.
The details are documented here: logmon Advanced IM Configuration (broadcom.com) --> Use Time Formatting Primitives
This KB contains Examples on how to use and test logmon date and time format for incremental log monitoring. This also describes how to monitor logs where logfile extension is based on the date and it is keeps changing every day.
DX UIM 23.4.*
url_response 4.* and later
Guidance
Examples:
Monitor a simple rotation / rolling date file / log
File name: 20241017.log
[The file name is named after the format YYYYmmdd (Year with century, Month as the decimal number, Day of the month as the decimal number). ]
The file name will be constructed with the following syntax:
Syntax to use: %Y%m%d.log
Monitor a rolling file that changes date and also time:
File name: TextLog_24.10.17_12.44.50.log
[The file name is named after the format <logname>_yy.mm.dd_hh.mm.ss.log (Year without century, Month as the decimal number, Day of the month as the decimal number_ Hour in 24-hour format.Minute as the decimal number, Seconds as decimal number)]
Syntax to use: TextLog_%y.%m.%d_%H.%M.%S.log
Monitor a rolling / rotation folder / path
Path and file name: /20241017/Todays_logs.log
[The path name is named after the format YYYYmmdd (Year with century, Month as the decimal number, Day of the month as the decimal number). ]
Syntax to use: /
%Y%m%d.log/Todays_logs.log
Monitor rolling files extensions:
File name: log.20241017
Syntax to use log.%Y%m%d
Note: When testing the file by clicking the "View" function which brings up the file, it validates the syntax of the file and path location.
You may see the error below:
Open file failed: error
The reason for this errors are either:
1. The file or path does not exist / not present in the destination
OR
2. The time / date primitive used does not correspond to the current date and time. To validate the file name and path with date primitives the probe does a strftime system call so it only finds the file if the file name or path name are current. If matching a file with "seconds" primitives (eg. TextLog_%y.%m.%d_%H.%M.%S.log) the time specific seconds in the syntax must NOT be earlier than the exact seconds tested otherwise you get the same error.