Logstash only logs the word 'log' on completion

I am using the following input configurations for deleting the files once read and log the information.

input {
  file {
    path => "C:/.log"
    mode => "read"
    file_completed_action => "log_and_delete"
    file_completed_log_path => "./ingested_files.log"
  }
}

Files are being read correctly and are being deleted after read operation is completed. The issue is, it only logs the word "log" in ingested_files.log whereas I want to log information about the file (timestamp and filename) which was read.

At the moment, ingested_files.log only contains "log" at every line.

The file input only logs the path, not the timestamp. Since you do not have any wildcard in the path option I would expect it only to log one value.

Thanks for the reply @Badger

Any suggestions about how can I log [TIMESTAMP] [Filename] to logs?

You would have to fork the code and edit that logging function.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.