How to close logstash using batch file command

Hi again :slight_smile: i would be glad if someone could provide helpful suggestion!
Logstash version : 2.3.2

I have written a batch file that start the logstash and starts reading config file.
Following is the batch file content:

  set JAVA_HOME=%~dp0ENV\java\jre8
  echo %JAVA_HOME%
  cd LS
 cd bin
 start cmd /k logstash -f FileName.config  

This batch file starts logstash and executes the config file.

Now after logstash done with parsing i have to close it using Ctrl+c manually.
So i want to know is there any command that i can add in batch file so that it automatically stops logstash after it finished parsing or after certain period of time????

How to stop programs from a batch file is more of a Windows question and I'd expect that you get better help elsewhere.

Figuring out when Logstash is done is a relevant question, though. The only thing you can do at the moment is monitor the sincedb file(s) and monitor when the current position in each file reaches the size of the file.

ok i would try to get something from sincedb file.
Thanks for the suggestion