Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Input file is deleted #319

Open
paradozed opened this issue Feb 16, 2023 · 1 comment
Open

[Windows] Input file is deleted #319

paradozed opened this issue Feb 16, 2023 · 1 comment
Labels

Comments

@paradozed
Copy link

Logstash deletes the input file when I start it in command line. As soon as the pipeline start. The file specified in the "path" parameter is removed.

import-index.conf:

input {
 file {
   path => ["C:/Users/normuser/logstash-8.6.1/datlog.log"]
   codec => json_lines
   mode => "read"
   start_position => "beginning"
 }
}
output {
 elasticsearch {
  hosts => [ "https://elastic.web:9200"]
  data_stream => true
  data_stream_namespace => "prod"
  data_stream_dataset => "3d"
  ssl => true
  ssl_certificate_verification => false
  api_key => "XXXXXX"
}
 stdout { }
}
  1. Logstash version 8.61
  2. ZIP Windows extracted
  3. How is Logstash being run : Command line "bin/logstash -f config/import-index.conf"

OS : Windows 10

@paradozed paradozed added the bug label Feb 16, 2023
@mtuska
Copy link

mtuska commented Nov 15, 2023

I ran into a similar issue recently, but when setting the mode to "read" the default action is to delete the files. setting "file_completed_action" to log will change this behaviour.
Of note, my environment is Linux so could be different for Windows.
https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-file_completed_action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants