Logstash configuration tips for Windows – Windows Service
August 22, 2014, with 0 commentsWhen you followed the previous posts (installation, log4net) you have a pretty good coverage of Logstash on your servers.
To avoid that Logstash is running on command line or even needs to be started manually upon reboot, you can run it as a Windows Service using nssm.
I decided to implement a small batch file which starts Logstash:
@echo off cd "\Logstash" set home="c:\logstash\sincedb" set LS_MAX_MEM=256m set JAVA_HOME=C:\Program Files (x86)\Java\jre7 Logstash-1.4.0\bin\logstash agent -f my-server.conf
You need to adjust the paths according to your environment.
The installation of the Windows Service with nssm is done using:
nssm install Logstash C:\logstash\startlogstash.bat
As mentioned in the log4net posting, I run decentral instances of Logstash which then forward the log entries to a central Redis instance.
This instance is also running as a Windows Service, installed in similar fashion:
nssm install "Redis Server" C:\logstash\redis\redis-server.exe
Aktualisiert am August 22, 2014