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?
jps -l
after logstash has started and extract pid value from the output.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.