0

I have the following NXLog config that reads a file from disk and forwards it to another host (syslog). By default, it appears NXLog only forwards the data in the log file if it has changed.

How can you configure 'nxlog.conf' so that it always forwards the file, even if the data is the same?

<Input in>
    Module     im_file
    File       "C:\\myfile.txt"
</Input>

<Output out>
    Module      om_tcp
    Host        127.0.0.1
    Port        12345
</Output>

<Route 1>
    Path        in => out
</Route>
GreekFire
  • 359
  • 4
  • 15

2 Answers2

0

After some digging on the NXLog forum, this cannot be done. Basically, NXLog will monitor the file (you can configure the frequency) for changes and re-transmit when it has appended values (or changed).

So, a workaround would be to delete the file and re-write the contents (on some schedule perhaps) to get NXLog to forward it again.

GreekFire
  • 359
  • 4
  • 15
0

NXLog won't re-read data from a file unless that file is updated while nxlog is running.

There is another workaround however. Add the ReadFromLast FALSE and SavePos FALSE to the im_file module definition and then periodically run nxlog -c <custom config> The custom config will have to specify a different pid location though.

Djarid
  • 446
  • 4
  • 11