在Windows上安装Logstash

在Windows上安装Logstash,logstash,elastic-stack,logstash-configuration,Logstash,Elastic Stack,Logstash Configuration,正在尝试将logstash安装为windows服务。当我从CMD手动运行它时,所有功能都正常,如下所示: C:\Elastic\Logstash\bin\logstash -f c:\Elastic\Logstash\config\logstash-sample.conf 我看到文件更改被更新并发布到控制台(根据.conf文件控制台输出) 但是,当我将Logstash安装为windows服务时: sc create Logstash binpath="\"C:\Elastic\Logstash

正在尝试将logstash安装为windows服务。当我从CMD手动运行它时,所有功能都正常,如下所示:

C:\Elastic\Logstash\bin\logstash -f c:\Elastic\Logstash\config\logstash-sample.conf
我看到文件更改被更新并发布到控制台(根据.conf文件控制台输出)

但是,当我将Logstash安装为windows服务时:

sc create Logstash binpath="\"C:\Elastic\Logstash\bin\logstash\" -f \"c:\Elastic\Logstash\config\logstash-sample.conf\""
它创建windows服务,但启动时将失败:

日志存储日志:

[2019-04-15T14:40:29605][ERROR][org.logstash.logstash] java.lang.IllegalStateException:Logstash停止处理,因为 错误提示:(SystemExit)exit

当我尝试使用NSSM安装logstash时,如下图所示,它会运行,但不起作用:

nssm.exe install logstash "C:\Elastic\Logstash\bin\logstash.bat" "agent -f C:\Elastic\Logstash\config\logstash-sample.conf"
找到解决方案: 我遇到的问题是由于“代理”关键字。在CMD中,我运行了以下命令:

nssm edit logstash
然后我得到了以下窗口和修改的参数: