i am at the moment using a vbs script to do this
This script works perfectly for some hours and stops for no reason. Can anyone point to me what is wrong with the script? How do i add logstash-forwarder to run as a service? I am having a hard time trying to figure out how to do this?
any help is appreciated.
Set WshShell = CreateObject("WScript.Shell")
cmds=WshShell.RUN("E:\logstash\logstash-forwarder.exe --config E:\logstash\conf.txt", 0, True)
Set WshShell = Nothing
I just had to deal with this issue and was able to resolve. I basically used @VinothNair's instructions from his answer however it was missing "AppParameters" which contains the "-config logstash-forwarder.conf" argument which is required for this to work.
I created a script called createService.bat in C:\temp\logstash-forwarder. I also copied the nssm.exe file into the same directory. You can download nssm from https://nssm.cc/release/nssm-2.24.zip. Extract and copy nssm-2.24\win64\nssm.exe to the same directory.