Running Logstash as a service on windows using NSSM is not working


I am trying to run Logstash as a service on windows using NSSM. It says the Logstash service is started successfully but I don't see any output logs(set the level as debug). Could it be related to permission issue? I gave all the permissions to Network Service account. Am I doing something wrong? Can someone please help me solve the issue?


1 Like

Can someone please help on this?

Just leave it running under System Account while you are troubleshooting, why complicate things?

If Logstash service fails to start and there is no log output it is usually because the JAVA HOME environment variable is not set (you can set this in the last "environment" tab on NSSM

As you say the service is definitely running, it can take 10 seconds before anything is written to the log.

Also, have you specified the log directory and level in the Logstash.yml file under logstash-x.x.x\config or have you specified this under the NSSM "Arguements" section. To keep things cleaner I prefer to specify the shipper file location and logging details in the Logstash.yml rather than using the NSSM arguments function.

I tried with Sysytem account, but still the same issue.

I have specified everything in logstash.yml file. Everything works as expected when running from command line. But when I try to start it as a service, it says Logstash is running but nothing is being written to the folders it is supposed to write to.

have you tried running the logstash.bat from the command line with the required shipper file and logging arguements?

I ran Logstash from command line with the command 'logstash -f myfile.conf' and all the options like path.logs and log.level are specified in logstash.yml. I could see the logs being written to path.logs file when ran from command line.

Just had an instance where NSSM launched and ran Logstash as a service ok but no logs were written and nothing was processed because the Logstash.yml path.logs setting was pointing to an invalid location and even the path.config for Shipper file was invalid. Surprised the NSSM Logstash service was actually running! I would copy and paste your command line parameters that worked into the arguements section of NSSM and comment out the logstash.yml file and see if that works.

So, running Logstash as a service is working fine when I put the arguments(in NSSM) as '-f C:logstash\install\bin\myfile.conf' but it's not working when I pass the arguments(in NSSM) as '--config C:\logstash\conf.d'

Hi, any update on this please?

Hi, I got it solved by changing "--config C:\logstash\conf.d" to "-f C:\logstash\conf.d"

1 Like

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