Reputation: 11
I am deploying nxlog on a Linux server (Red Hat Enterprise release 6.6). I am currently trying to remove a file after nxlog has finished processing. From the nxlog documentation, I am using file_remove, which is not working. Here is my config that does not throw any syntax errors when starting nxlog. As seen, I used a time interval of every 1 minute as I do not know the best way to have the file deleted after processing. In the debug log, I do not see an attempt to try and match files in the directory for removing:
########################################
# Global directives #
########################################
User nxlog
Group nxlog
LogFile /var/log/nxlog/nxlog.log
LogLevel DEBUG
########################################
# Modules #
########################################
<Extension _syslog>
Module xm_syslog
</Extension>
<Extension fileop>
Module xm_fileop
<Schedule>
Every 1 min
Exec file_remove('/eventarchive/processed/*.raw', (now()));
</Schedule>
</Extension>
<Input in1>
Module im_file
File "/eventarchive/processed/*.raw"
SavePos TRUE
#Exec parse_syslog_bsd();
</Input>
<Output fileout1>
Module om_udp
Host 10.102.103.112
Port 3333
Exec to_syslog_bsd();
</Output>
########################################
# Routes #
########################################
<Route 1>
Path in1 => fileout1
</Route>
I used this same syntax on a Windows setup to test it, which worked; it successfully removed files. On the Linux setup, I have also tried setting a filename instead of "*.raw" but that did not work either. Is there something I'm doing wrong? Does anyone know if there are any limitations with Linux that would stop this from working?
Does anyone know the best way to configure nxlog to remove a file after processing, as opposed to setting a time interval of 1 second like above?
Thanks in advance!
Upvotes: 1
Views: 1065