file_remove with Windows Shortcut and wildcard

View thread

Traqueur56

Hello

I have to use nxlog to read SAS log file from SAS Guide. It's about more than 1.000 users in my company.

Nxlog is installed on these 1.000 laptops, and the SAS Log files are under a directory like c:\Users\A012345\Logs*.log

-> I can't change this directory ... -> A012345 is an exemple of the employee number. So, I have one different directory for all 1.000 laptops.

I have to find a solution to bypass these employee numbers variable and find a generic expression to access to this directory.

So, I can't use a wildcard directly in log directory (c:\Users*\Logs*.log), nxlog can't do that.

I have a solution by using a Windows Shortcut.

I create a shortcut "D:\Temp\SAS-Logs" with a link to my official directory c:\Users\A012345\Logs.

And my nxlog input with im_file works perfectly.

Now, I'm faced to another problem. I must manage the SAS logs file retention.

I'm testing the file_remove function. When I specify my official directory (c:\Users\A012345\Logs*.log), it works perfectly. When I'm using the same shortcut (which works with my Im_file), nxlog says he can't find the directory.

What is a the problem, the file_remove function uses another library ?

Do you any idea to suppress my "old" sas log file with nxlog ?

Thanks Arnaud