I'm using NXLog to read log files and send to to Logstash. Normally this works fine, but I'm now trying to send logs from a file, where the new events gets added at the top of the file, not the bottom. Now it's not sending anything.

This is from my NXLog config.

<Input file>
Module  im_file
File "C:\\TEMP\\export.txt"
InputType LineBased
Exec $Message = $raw_event;
SavePos TRUE    
ReadFromLast TRUE
Exec if $raw_event =~ /^#/ drop();                    

Is it possible to read from bottom to top?

AskedJuly 31, 2015 - 9:29am

Answer (1)

I don't think that's possible, this would need a special module. Appending new lines to the beginning of the file also means that the log source will either truncate and rewrite the whole file with the new line prepended, or it creates a new file and deletes the old. This in itself would be quite confusing to im_file.