manage logstash from Java -


i want manage starting , stopping of logstash java. there easy/nice way this?

so, can give me example of how start logstash without needing logstash instance started run.bat manually.?

you can run batch file process in java this

string cmd = "cmd /c start c:\\path\\to\\run.bat"; process logstashprocess = runtime.getruntime().exec(cmd); 

and kill process calling destroy() method when needed

logstashprocess.destroy(); 

you can add these startup , shutdown hooks of application (the application log analyzing using logstash) or write standalone java app maintain starting , stopping logstash.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -