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
Post a Comment