1

I am trying to to run Logstash as a service in Windows. It works fine when given a path that has no space, but when I give a path that does have a space in it I am unable to run Logstash successfully.

In my batch file I've used "",'',""" """,\" \" to handle spaces.

Here is the code:

 set USER_INSTALL=D:\test logstash
    echo  Going to start logstash.
    cd "%USER_INSTALL%\logstash-5.5.2\bin"
    nssm install mySERVICE "%USER_INSTALL%\logstash-5.5.2\bin\logstash.bat" -f %CONFIG_FILE_NAME%
    nssm set  mySERVICE AppDirectory "%USER_INSTALL%\logstash-5.5.2\bin"
    nssm mySERVICE Start 

I've also tried to run Logstash directly from command line:

C:\Users\Admin\Desktop\dryrun9-7-2017\test agent\agent\bin> .\logstash.bat -f shipper.conf

This gives an error that the system cannot find the path specified.

Bas Peeters
  • 3,269
  • 4
  • 33
  • 49
mehak
  • 11
  • 4
  • you already put your path/filenames into quotes. This should be enough to handle the space(s) properly (quoting `%Config_File_Name%` too might be a good idea). Are you sure, the problem isn't inside `logstash.bat`? – Stephan Sep 14 '17 at 12:34
  • Thank You Stephan i tried quoting %Config_File_Name% and also give absolute path for %Config_File_Name% but it didn't work. – mehak Sep 14 '17 at 12:48
  • For logstash.bat file i tried echo echo logstash in first line but it just return the error the system can't find the path specified. – mehak Sep 14 '17 at 12:54

0 Answers0