NetXMS Support Forum

English Support => General Support => Topic started by: Tursiops on August 15, 2017, 06:16:24 AM

Title: Logwatch - Environment Variables
Post by: Tursiops on August 15, 2017, 06:16:24 AM
Hi,

Just wondering, do/shoulod environment variables work in a Logwatch parser definition?
I tried using %PROGRAMDATA% and the result was that the NetXMS Agent service would not start anymore. The moment I replaced that with C:\ProgramData everything just worked. As different Windows versions use different paths, using an environment variable would be preferable to creating a number of parsers (one for each possible file location)?

Cheers
Title: Re: Logwatch - Environment Variables
Post by: Victor Kirhenshtein on August 15, 2017, 02:12:52 PM
Hi,

you can use time formats, environment variables, and shell commands for file name expansion in parsers. To insert environment variable, use macro ${name}. To insert result of shell command use form `command`. Time formats are the same as supported by strftime (http://www.cplusplus.com/reference/ctime/strftime/ (http://www.cplusplus.com/reference/ctime/strftime/)).

Best regards,
Victor