UNC Paths in im_file

Tags:

#1 akumar

Not sure it can be achieved but wanted to check as to what was the best way to use UNC names in the File path. 

I want to stage files locally from a remote location, digest and then delete the files.

I have tried "//FileServer/directory/file as well as "\\FileServer/directory/file" without success.

Is it possible to use a variation of im_exec such as 

<Input mapdrive>

  Module  im_file

command  net 

arg           use

arg           z:

arg          "\\fileserver\directory"   ....etc?

 

Thanks 

 

Ash

 

#2 adm Nxlog ✓
#1 akumar
Not sure it can be achieved but wanted to check as to what was the best way to use UNC names in the File path.  I want to stage files locally from a remote location, digest and then delete the files. I have tried "//FileServer/directory/file as well as "\\FileServer/directory/file" without success. Is it possible to use a variation of im_exec such as  <Input mapdrive>   Module  im_file command  net  arg           use arg           z: arg          "\\fileserver\directory"   ....etc?   Thanks    Ash  

The file path is passed to the OS as is so I don't think UNC format has anything to do with that.

In this case probably im_exec is not what you need since the net use command will not emit any logs in itself. If I understand correctly, what you want is basically this:

  1. mount network drive
  2. process files
  3. delete processed files
  4. unmount network drive

For this I'd recommend creating a script that does this and invoke that periodically. You can use nxlog-processor for step 2.

Otherwise if you still want to run nxlog as a service, you can use the exec() procedure exported by xm_exec which you probably want to call from a <Schedule> block.