There are multiple ways to do what you want - depending on your requirements:
Use an environment variable in the schedule. Your application would have to stop logstash, set the new value for the environment variable and start Logstash again
Use automatic config reloading. Your application would have to change the Logstash pipeline file. Logstash would detect the change and restart the pipeline
Use centralized pipeline management. Your app would have to use the Kibana API (experimental) to update the logstash pipeline. Logstash would detect the change and restart the pipeline
Maybe there are better ways to do that. but this is what I am aware of.
Hi @Wolfram_Haussig
Thanks for the response and the information you have provided is very much helpful.
I was reading the links you shared. Can you please help on the below points
Can you please give an example Where I need to set the environmental variable and How to load that to logstash in windows
where i need to set this export Schedule="*/1 * * * *"
Is there a way to change the logstash pipeline file with java programm.
The Java program works fine, Thank you very much.
Before starting the logstash I always need to kill the old process right? Can we do that with Java/ with script.
Since I'm working on windows i couldn't verify Linux/Unix command. It would be great and helpful, if you can provide windows command, So I'll skip Java and write a power shell script
Although Java does not support killing processes natively, you can use windows tools to do that(start them the same way as the logstash example above):
Get the process using the tasklist commandline tool
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.