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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -