DX Unified Infrastructure Management

 View Only

 monitoring of log file creation

Nijin K's profile image
Nijin K posted Dec 01, 2022 07:19 AM
Hi all 

Wanted to check if somebody has monitored log file generation as in some log with some naming convention is being generated on daily basis, can we monitor those log generate daily or not 

attaching screenshot for reference of naming convention

Luc Christiaens's profile image
Luc Christiaens
see: https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/ca-unified-infrastructure-management-probes/GA/monitoring/systems-and-service-response/logmon-log-monitoring/logmon-ac-configuration/logmon-advanced-ac-configuration.html
Section: "Use Time Formatting Primitives"
Garin Walsh's profile image
Garin Walsh
A logmon profile monitors all logs that match the path and filename pattern - for most people that reduces to "c:\directory\file.log" and the perception that logmon is monitoring a log file.

But if you gave logmon the value "c:\directory\*.log" it's going to simultaneously monitor all files with the extension .log in that directory.

So like Luc indicated you can use the time primitives to nail a log file exactly or you can use broader wildcards to get them.

For a case like yours I would typically approach it with a combination like "c:\directory\MicrosoftReport_Default_%Y*.xlsx" 

There's some argument still (at least in my head) about how logmon behaves on the time primitive boundaries.

So what happens with this pattern MicrosoftReport_Default_%Y*.xlsx and a check interval of say 60 minutes when the logmon cycles at 11:30pm on 12/31/2022 and something writes to the file at 11:45pm and then logmon next cycles on 1/1/2023 at 00:30 am and now the %Y primitive is 2023 instead of 2022 - will it get those last writes to the MicrosoftReport_Default_2022-12-31_23_00.xlsx file? It was active but it no longer matches the patter.

So, I'd not go down to the minute on the primitives for that reason. Also most versions of logmon have an issue when matching more than about a thousand files with a pattern - it is either really slow or it crashes. Newest logmon version fixes the crash issue.