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

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -