0

I have a batch script and via that script I have started the logstash. Its running successfully and writing logstash logs in my own file.

logstash.bat -f CONFIG_FILE_NAME >> C:\User\logs\agent.log

Now I want to create my own Process Id for logstash and want to write that pid in a file.

I am able to do this in linux by following command.

./logstash -f $CONFIG_FILE_NAME --config.reload.automatic > ../logs/agent.log & echo $! >>/$current_dir/$LOGSTASH_FOLDER/agent.pid

How can I do that in windows?

2
  • There is a discussion about adding an option to write a pid-file, but so far developers have been reluctant to do that. So, I guess, the only option is to separately run jps -l after logstash has started and extract pid value from the output. Commented Aug 29, 2017 at 6:26
  • Can you show the logic that's in the logstach.bat file or explain from the batch side of that works for the execution of what and how that's triggered? Getting a PID is not hard and possible if you are referring to the actual process id of an executed process. Help me understand some of that and I may be able to help you with this task once I'm 100% certain I understand your process, the logic, etc. Commented Sep 1, 2017 at 2:29

0

You must log in to answer this question.

Browse other questions tagged .