windows下logstash从文件中读数据写入es报错 Error: No such file or directory - :/dev/null

 [2023-12-22T17:26:50,327][ERROR][logstash.javapipeline    ][main][897a6c7006446c97daa2ee44df7541701882ceece289ce428fcfac8aa982a0c5] A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: "beginning", path=>["D:/angus/es/logstash-7.11.1/config/modified_json_lines.json"], codec=>"json_d9cd9a05-9f06-48af-a4fa-a2fd6b414869", enable_metric=>true, charset=>"UTF-8">, id=>"897a6c7006446c97daa2ee44df7541701882ceece289ce428fcfac8aa982a0c5", sincedb_path=>"/dev/null", enable_metric=>true, stat_interval=>1.0, discover_interval=>15, sincedb_write_interval=>15.0, delimiter=>"\n", close_older=>3600.0, mode=>"tail", file_completed_action=>"delete", sincedb_clean_after=>1209600.0, file_chunk_size=>32768, file_chunk_count=>140737488355327, file_sort_by=>"last_modified", file_sort_direction=>"asc", exit_after_read=>false, check_archive_validity=>false>
  Error: No such file or directory - D:/dev/null
  Exception: Errno::ENOENT
  Stack: org/jruby/RubyIO.java:1237:in `sysopen'
org/jruby/RubyFile.java:365:in `initialize'
org/jruby/RubyIO.java:1156:in `open'
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/fileutils.rb:1136:in `block in touch'
org/jruby/RubyArray.java:1809:in `each'

错误消息表明 Logstash 在尝试使用 sincedb_path 时遇到了问题,该路径被设置为 "/dev/null"。问题是,/dev/null 是 Unix 系统上的特殊文件,而您似乎正在运行 Logstash 在 Windows 系统上。Windows 上的 sincedb_path 路径应该是一个实际的文件路径,而不是 /dev/null

解决方法是在 Logstash 配置文件中指定一个有效的 sincedb_path。请修改您的 Logstash 配置文件,将 sincedb_path 修改为 Windows 上的有效路径,例如:

input {
  file {
    path => "D:/angus/es/logstash-7.11.1/config/modified_json_lines.json"
    start_position => "beginning"
    sincedb_path => "D:/angus/es/logstash-7.11.1/data/sincedb"
    codec => "json"
  }
}

output {
  # 其他输出配置...
}

确保 sincedb_path 的目录存在,并对 Logstash 进程有写入权限。修改配置文件后,重新运行 Logstash。

此外,请确保 Logstash 配置文件中的其他路径和参数也正确,并确保 Logstash 进程有读取指定文件的权限。

你可能感兴趣的:(Elasticsearch,windows,elasticsearch,大数据,logstash)